|
|
<INPUT ...>onKeyPress = "script command(s)"| Usage Recommendation |
|---|
| use it, but don't rely on it |
onKeyPressonKeyPressonKeyPress
For our first example, this short form contains several radio buttons and a single text field. The text field is for the "Other" radio button. Typing data in the text field implies that the "Other" button should be checked, so we'll use onKeyPressonKeyPress
<FORM ACTION="../cgi-bin/mycgi.pl" METHOD=POST> How did you hear about our company?<BR> <INPUT TYPE=RADIO NAME="media" VALUE="internet">Internet<BR> <INPUT TYPE=RADIO NAME="media" VALUE="newspaper">Newspaper<BR> <INPUT TYPE=RADIO NAME="media" VALUE="tv">Television<BR> <INPUT TYPE=RADIO NAME="media" VALUE="other">Other ... <INPUT NAME="othermedia" onKeyPress="var m=this.form.media;m[m.length -1].checked=true"><BR> <INPUT TYPE=SUBMIT VALUE="send it"> </FORM>
This gives us this form:
In the next page we discuss how to cancel the key press event.|
Recommended Resources |
|||
| web hosting tutorials Credit Help |
Search the Internet Search Engine Help |
Low Fat Lifestyle Internet Traffic |
Web
Hosting Web Design |
|
Discount
Hotel Reservations All
Rights Reserved, Copyright © Free-HTML-Tutorials.com 2003 |
|||