i have the following on my site
[code]
<script type=”text/javascript”>
function validate(f) {
if (f.ipbin1.value == 10101100) {
alert (“Well Done, try the next one”);
} else {
alert (“Incorrect, Have another go!”);
}
return false;
}
function validate(f) {
if (f.ipbin2.value == 00111000) {
alert (“Well Done, try the next one”);
} else {
alert (“Incorrect, Have another go!”);
}
return false;
}
function validate(f) {
if (f.ipbin3.value == 11100000) {
alert (“Well Done”);
} else {
alert (“Incorrect, Have another go!”);
}
return false;
}
</script>
and then the forms:
[code]<form name =”ipbin1″ onSubmit=”return validate(this)”>
<input type=”text” name=”ipbin1″ size=”8″>
<input type=”submit” value=”Submit” name=”B1″>
</form></td>
</tr>
<tr>
<td width=”249″ bgcolor=”#003366″ align=”left”>
<p align=”left”>Convert 56 into Binary</td>
<td width=”188″>
<p align=”center”>>></td>
<td><form name =”ipbin2″ onSubmit=”return validate(this)”>
<input type=”text” name=”ipbin2″ size=”8″>
<input type=”submit” value=”Submit” name=”B2″></form></td>
</tr>
<tr>
<td width=”249″ bgcolor=”#003366″ align=”left”>
<p align=”left”>Convert 224 into Binary</td>
<td width=”188″>
<p align=”center”>>></td>
<td><form name =”ipbin3″ onSubmit=”return validate(this)”>
<input type=”text” name=”ipbin3″ size=”8″>
<input type=”submit” value=”Submit” name=”B3″></form></td>
Why does the third form validate fine but the first 2 dont?
cheers for any help