1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
<html>
<head>
<title>TEST</title>
<script type="text/javascript"><!-- hide from old browsers
function validate (form) {
var alertstr = '';
var invalid = 0;
var invalid_fields = new Array();
// sex: radio group or multiple checkboxes
var sex = null;
var selected_sex = 0;
for (var loop = 0; loop < form.elements['sex'].length; loop++) {
if (form.elements['sex'][loop].checked) {
sex = form.elements['sex'][loop].value;
selected_sex++;
if (sex == null || (sex != '1' && sex != '3' && sex != '5')) {
alertstr += '- Choose one of the "glass EYE fucker" options\n';
invalid++;
invalid_fields.push('sex');
}
} // if
} // for sex
if (! selected_sex) {
alertstr += '- Choose one of the "glass EYE fucker" options\n';
invalid++;
invalid_fields.push('sex');
}
if (invalid > 0 || alertstr != '') {
if (! invalid) invalid = 'The following'; // catch for programmer error
alert(''+invalid+' error(s) were encountered with your submission:'+'\n\n'
+alertstr+'\n'+'Please correct these fields and try again.');
return false;
}
return true; // all checked ok
}
//-->
</script>
</head>
<body>
<form action="TEST" method="get" onsubmit="return validate(this);"><input id="_submitted" name="_submitted" type="hidden" value="1" />
<table>
<tr valign="top">
<td>
Name
</td>
<td>
<input id="name" name="name" type="text" />
</td>
</tr>
<tr valign="top">
<td>
Color
</td>
<td>
<input id="color_red" name="color" type="checkbox" value="red" /> <label for="color_red">1</label>
<input id="color_blue" name="color" type="checkbox" value="blue" /> <label for="color_blue">2</label>
<input checked="checked" id="color_yellow" name="color" type="checkbox" value="yellow" /> <label for="color_yellow">3</label>
<input id="color_pink" name="color" type="checkbox" value="pink" /> <label for="color_pink">4</label>
</td>
</tr>
<tr valign="top">
<td>
Email
</td>
<td>
<input id="email" name="email" type="text" />
</td>
</tr>
<tr valign="top">
<td>
<b>glass EYE fucker</b>
</td>
<td>
<input id="sex_1" name="sex" type="radio" value="1" /> <label for="sex_1">2</label>
<input id="sex_3" name="sex" type="radio" value="3" /> <label for="sex_3">4</label>
<input id="sex_5" name="sex" type="radio" value="5" /> <label for="sex_5">6</label>
</td>
</tr>
<tr valign="top">
<td>
Size
</td>
<td>
<input id="size" name="size" type="text" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<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" />
</td>
</tr>
</table>
</form>
</body>
</html>
|