P
Philip WATTS
Can anyone tell me why the following script always returns my "failed test"
result. Surely if my input of "No1" is below 10 I should get the "Test1
past" message.
Thanks
Phil
function test1(data1){
if (data1>10){
return false
}
}
function tests(){
var no1=document.form1.number1.value
var no2=document.form1.number2.value
if (!test1(no1)){
alert("test failed"+no1)
}else{
alert("test1 passed")
}
}
</script>
</head>
<body>
<form name="form1">
<input type="text" name="number1">
<input type="text" name="number2">
<input type="button" value="test" Onclick="tests()">
</form>
</body>
</html>
result. Surely if my input of "No1" is below 10 I should get the "Test1
past" message.
Thanks
Phil
function test1(data1){
if (data1>10){
return false
}
}
function tests(){
var no1=document.form1.number1.value
var no2=document.form1.number2.value
if (!test1(no1)){
alert("test failed"+no1)
}else{
alert("test1 passed")
}
}
</script>
</head>
<body>
<form name="form1">
<input type="text" name="number1">
<input type="text" name="number2">
<input type="button" value="test" Onclick="tests()">
</form>
</body>
</html>