I have problems with this code:
If i only called the first form, it will work correctly. But how do I call the second argument and third argument in the same function?
Please advice. THanks.
form name="Form">
Enter a number between 5 and 45: <input type="text" name="Field" size="5">
<input type="button" value="Check & Alert" onClick="CheckValue()"> <br>
Enter a number between -123 and 467: <input type="text" name="Field" size="5">
<input type="button" value="Check & Prompt" onClick="CheckValue()"> <br>
</form>
<SCRIPT>
function CheckValue(a,upper,lower)
{
a = eval(document.Form.Field.value)
upper=eval(document.Form.Field2.value)
if ( a >= 5 && a <= 45) {
alert("You are OK."
}
else {
alert("You are not OK."
}
if (upper<-123 && upper>467){
prompt("You are not OK."
}
</SCRIPT>
If i only called the first form, it will work correctly. But how do I call the second argument and third argument in the same function?
Please advice. THanks.
form name="Form">
Enter a number between 5 and 45: <input type="text" name="Field" size="5">
<input type="button" value="Check & Alert" onClick="CheckValue()"> <br>
Enter a number between -123 and 467: <input type="text" name="Field" size="5">
<input type="button" value="Check & Prompt" onClick="CheckValue()"> <br>
</form>
<SCRIPT>
function CheckValue(a,upper,lower)
{
a = eval(document.Form.Field.value)
upper=eval(document.Form.Field2.value)
if ( a >= 5 && a <= 45) {
alert("You are OK."
}
else {
alert("You are not OK."
}
if (upper<-123 && upper>467){
prompt("You are not OK."
}
</SCRIPT>