
September 12th, 2000, 04:29 AM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,578
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
<i><b>Originally posted by : Mitesh (miteshrp@hotmail.com)</b></i><br /><br />Yes Ashwani You can use more than one submit button in a form<br /><br />But you need To design it properly For eg i show You<br /><br /><table><br /><tr><td><form method = post action = "next.asp"><br /><input type = submit value = Next></form></td></tr><br /><tr><td><form method = post action = "previous.asp"><br /><input type = submit value = Previous></form></td></tr><br /><tr><td><form method = post action = "last.asp"><br /><input type = submit value = last></form></td></tr><br /></table><br /><br />This is method by which we can use one more than one submit button in one form<br /><br />The main logic is that we have to start the form a<br />nd create submit button in that instance of form only and that end form with </form> and then again you have to use antother form tag for another submit button in same page as many you can<br /><br />if you want you can pass values independently to each form use you have create object in each form<br />now it can be hidden or some text object or other.then you can pass values independently also<br />to each form and process that form.<br /><br />Ok<br /><br /><br />------------<br />Ashwani at 9/11/2000 1:57:58 PM<br /><br />Input buttom controls of type SUBMIt actually do submit the form to the server, and their VALUE attribute is included with the values of other <br />controls on the form, provided include a NAME attribute in the HTML definition. For ex. this form might be part of a wizard-style Web <br />application, allowing the user to step through each page or cancel the process part way through:<br /><br /><FORM ACTION="ABCD.ASP" METHOD="POST"><br /> <INPUT TYPE="SUBMIT" NAME="btnSubmit" VALUE = "Next"><br /> <INPUT TYPE="SUBMIT" NAME="btnSubmit" VALUE = "Previous"><br /> <INPUT TYPE="SUBMIT" NAME="btnSubmit" VALUE = "Cancel"><br /></FORM><br /><br />You can include more than one SUBMIT button on a form, and in this case you should give each one a unique VALUE attribute, as shown above. When this <br />form is submitted, your iteration through the values in the REQUEST. Form collection will produce one value, depending on which button was used to submit the form. If the user clicks the Previous button, he'll get just :<br /><br />btnSubmit = Previous<br /><br />Therefore, he can query the Request.Form collection to decide which page to display next, for example :<br /><br />Select Case Request.Form("btnSubmit")<br /><br /> Case "Next"<br /> Response.Redirect "page_3.asp"<br /><br /> Case "Previous"<br /> Response.Redirect "page_1.asp"<br /><br /> Case "Cancel"<br /> Response.Redirect "main_menu.asp"<br /><br />End Select<br /><br /><br /><br />
|