2
<title>User Info</title>
3
Please update your info and hit "Submit".
4
<script type="text/javascript"><!-- hide from old browsers
5
function validate (form) {
8
var invalid_fields = new Array();
10
// sex: radio group or multiple checkboxes
13
for (var loop = 0; loop < form.elements['sex'].length; loop++) {
14
if (form.elements['sex'][loop].checked) {
15
sex = form.elements['sex'][loop].value;
17
if (sex == null || (sex != '1' && sex != '3' && sex != '5')) {
18
alertstr += '- Choose one of the "glass EYE fucker" options\n';
20
invalid_fields.push('sex');
25
alertstr += '- Choose one of the "glass EYE fucker" options\n';
29
if (invalid > 0 || alertstr != '') {
30
if (! invalid) invalid = 'The following'; // catch for programmer error
31
alert(''+invalid+' error(s) were encountered with your submission:'+'\n\n'
32
+alertstr+'\n'+'Please correct these fields and try again.');
35
return true; // all checked ok
40
<form action="TEST" method="get" onsubmit="return validate(this);"><input id="_submitted" name="_submitted" type="hidden" value="1" />
41
Enter your name: <input id="name" name="name" type="text" />
42
Select your Color: <select name="color" multiple>
43
<b><option VALUE="red">1</option></b>
44
<b><option VALUE="blue">2</option></b>
45
<b><option VALUE="yellow">3</option></b>
46
<b><option VALUE="pink">4</option></b>
49
glass EYE fucker = <radio name="sex" value="1">2<br><radio name="sex" value="3">4<br><radio name="sex" value="5">6<br>
50
FYI, your dress size is (unknown)<br>
51
<input id="_submit" name="_submit" onclick="this.form._submit.value = this.value;" type="submit" value="Update" /><input id="_submit_2" name="_submit" onclick="this.form._submit.value = this.value;" type="submit" value="Delete" />