Tutorial 13: Giving Form to Forms
|
| ||||
| ||||
Submit buttons
A submit button is a button which, when clicked (or otherwise activated), will submit the form with its current values. Submit buttons may have names and values, or they may not. If they don't then the button simply says "Submit Query" or something similar. Otherwise, it displays the contents of the VALUE attribute. You can also have multiple submit buttons with different names and/or values, so clicking on a different button will produce a different result. So, our subscription form can be completed like this: (Note: actually submitting the following forms will just load the current page again).
<FORM ACTION="/cgi-bin/html/formdump.cgi" METHOD="GET" ENCTYPE="application/x-www-form-urlencoded"> <P>Enter your e-mail address: <INPUT TYPE="text" NAME="email" SIZE="30"> <P>Subscribe <INPUT TYPE="radio" NAME="action" VALUE="subscribe"> Unsubscribe <INPUT TYPE="radio" NAME="action" VALUE="unsubscribe" CHECKED> <INPUT TYPE="submit" VALUE="Submit"> </FORM>
Or, it can be rewritten like this:
<FORM ACTION="/cgi-bin/html/formdump.cgi" METHOD="GET" ENCTYPE="application/x-www-form-urlencoded"> <P>Enter your e-mail address: <INPUT TYPE="text" NAME="email" SIZE="30"> <P> <INPUT TYPE="submit" NAME="action" VALUE="Subscribe"> <INPUT TYPE="submit" NAME="action" VALUE="Unsubscribe"> </FORM>




