Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    May 2004
    Location
    San Jose, CA
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Submit as Text Link

    Here's the code:
    Code:
    <INPUT TYPE="submit" NAME="-FindAll" VALUE="Show All Employees">
    I want that submit button to be a text link. However, I also need to be sure that the NAME of the button is sent along with the submission. It's running a querry to a database and needs the NAME to return the correct information.
    Code:
    <a href="#" onClick="document.staff_search.submit();">click here</a>.</p>
    has been suggested, but I need to make sure that the NAME is passed, too. Without it, an error is returned because the database doesn't know what to look for. By the way, "staff_search" is the name of the form I want to submit. There are two forms on the page.

    Next thing I'd like is a way to submit that button, with that NAME, on page load.

    Thanks, all.
    -ts
    -Challenge The Status Quo
    -www.toddseal.com/rodin

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Why not include a hidden input with the NAME as its value and reference that

  • #3
    Regular Coder
    Join Date
    May 2004
    Location
    San Jose, CA
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not sure I see how you'd do that... Can you show me what you mean?
    -ts
    -Challenge The Status Quo
    -www.toddseal.com/rodin

  • #4
    Regular Coder
    Join Date
    Jun 2004
    Posts
    565
    Thanks
    0
    Thanked 18 Times in 18 Posts
    Put this in your form:
    Code:
    <input type='hidden' name='-FindAll' value='Show All Employees'>
    dumpfi

  • #5
    Regular Coder
    Join Date
    May 2004
    Location
    San Jose, CA
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, folks. I still don't see how creating a new input field helps me get a text link to submit the form with the name. Once I put in that hidden input, what do I do with it?
    -ts
    -Challenge The Status Quo
    -www.toddseal.com/rodin

  • #6
    Regular Coder
    Join Date
    Jun 2004
    Posts
    565
    Thanks
    0
    Thanked 18 Times in 18 Posts
    If i remember correctly input fields are used to send data to a server. And isn't exactly what you want to do is sending data?

    And once you have put that input field into the form it sends its data to the server on submit. And the server receives it. Obviously, isn't it? And *surprise* *surprise* the server can then work with the data. Nice, isn't it?

    dumpfi

  • #7
    Regular Coder
    Join Date
    May 2004
    Location
    San Jose, CA
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ah! So it sends that value on submit. Got it and it works. Here's the finished code, added to my already existing form:
    Code:
    <input type='hidden' name='-FindAll' value='Show All Employees'>
    <p><a href="#" onClick="document.staff_search.submit();">See a list of all the employees at Silver 
    
    Creek High School, along with links to more specific contact information</a>.</p>
    
    <noscript>
    <INPUT TYPE="submit" NAME="-FindAll" VALUE="Show All Employees">
    </noscript>
    Thanks!
    -ts
    -Challenge The Status Quo
    -www.toddseal.com/rodin


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •