Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Submit Buttons??

Status
Not open for further replies.

usp004

ISP
Jul 10, 2000
46
US
I have and asp page that reads records from a DB and then displays them in a table. Some fields will be INPUT boxes to allow for editing.

There will be several SUBMIT buttons on this page depending on how many records were returned from the DB. How can I validate the INPUT boxes that belong to the SUBMIT button that the user has clicked on?

Thanks.
 
could create different <Forms> </Forms> each with a Hidden value in them specifying which box or input that form is for.

<form ....>
<input type=&quot;hidden&quot; name=&quot;button&quot; value=&quot;secondbutton&quot;>
<input....
<intput type=&quot;submit&quot;>
</form>
 
Sorry, kb244, but your answer isn't correct.

usp004, if you place &quot;name&quot; field to input tag, than &quot;value&quot; field (which is displayed on button) will be sent to server. For example:
Code:
<form...>
<input type=&quot;hidden&quot; name=&quot;a&quot; value=&quot;1&quot;>
<input type=&quot;submit&quot; name=&quot;b&quot; value=&quot;Prev&quot;>
<input type=&quot;submit&quot; name=&quot;b&quot; value=&quot;Next&quot;>
</form>
will display two buttons (&quot;Prev&quot; and &quot;Next&quot;) and:
pressing on &quot;Prev&quot; button will send:
Code:
a=1&b=Prev
pressing on &quot;Next&quot; will send:
Code:
a=1&b=Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top