...

View Full Version : Submit as Text Link



tsguitar2004
08-13-2004, 10:45 PM
Here's the 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.


<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

Mr J
08-13-2004, 11:16 PM
Why not include a hidden input with the NAME as its value and reference that

tsguitar2004
08-13-2004, 11:33 PM
Not sure I see how you'd do that... Can you show me what you mean?
-ts

dumpfi
08-14-2004, 12:06 AM
Put this in your form:
<input type='hidden' name='-FindAll' value='Show All Employees'>

dumpfi

tsguitar2004
08-14-2004, 12:08 AM
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

dumpfi
08-14-2004, 12:28 AM
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

tsguitar2004
08-14-2004, 12:47 AM
Ah! So it sends that value on submit. Got it and it works. Here's the finished code, added to my already existing form:
<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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum