I have the below script that checks to make sure that the field is not empty
I need to check thre other functions
I have 6 text boxes as you can see I need three other validations the first being
no 0 in front of a number so your cannot add 02 just 2 but you can add 20
The second is you cannot type in a number higher than 44 or lower than 1 but you can type in 44 and 1
And last you can only type numbers and not letters
Any help would be great
Thanks
Nick
<script>
function validate(){
if (document.daform.text1.value==""
{
alert ("Enter a number in Ball one"
return false
}
else
if (document.daform.text2.value==""
{
alert ("Enter a number in Ball two"
return false
}
else
if (document.daform.text3.value==""
{
alert ("Enter a number in Ball three"
return false
}
else
if (document.daform.text4.value==""
{
alert ("Enter a number in Ball four"
return false
}
else
if (document.daform.text5.value==""
{
alert ("Enter a number in Ball five"
return false
}
if (document.daform.power.value==""
{
alert ("Enter a number in the Bonus ball section"
return false
}
else
return true
}
</script>
<FORM NAME="daform" METHOD="post" ACTION="results.asp" ONSUBMIT="return validate()">
I need to check thre other functions
I have 6 text boxes as you can see I need three other validations the first being
no 0 in front of a number so your cannot add 02 just 2 but you can add 20
The second is you cannot type in a number higher than 44 or lower than 1 but you can type in 44 and 1
And last you can only type numbers and not letters
Any help would be great
Thanks
Nick
<script>
function validate(){
if (document.daform.text1.value==""
alert ("Enter a number in Ball one"
return false
}
else
if (document.daform.text2.value==""
alert ("Enter a number in Ball two"
return false
}
else
if (document.daform.text3.value==""
alert ("Enter a number in Ball three"
return false
}
else
if (document.daform.text4.value==""
alert ("Enter a number in Ball four"
return false
}
else
if (document.daform.text5.value==""
alert ("Enter a number in Ball five"
return false
}
if (document.daform.power.value==""
alert ("Enter a number in the Bonus ball section"
return false
}
else
return true
}
</script>
<FORM NAME="daform" METHOD="post" ACTION="results.asp" ONSUBMIT="return validate()">