Click to See Complete Forum and Search --> : Form entry Problem!!
jjudge
02-12-2003, 08:10 AM
I am having a problem with a form entry, I have a text box where you have to enter a number to search for an account but the number has to be between 1000 and 69999 and it HAS to be a number!!My script is doing this and it brings up a message for the user but when i press search again it just searches for the account and dose not bring up the message a second time??Also i was wondering how i could clear the number in the txt box if it was not correct and leave a blank textbox so the user can enter a new number i.e. between 1000 and 69999??
Thank you for your time,
James.
Please find my code enclosed!!
khalidali63
02-12-2003, 08:44 AM
try this piece
cheers
Khalid
<script>
function check(obj,val){
var minval = 1000;
var maxval = 69999;
tmpval = val/1;
if(isNaN(tmpval)) {
alert("Please Enter ONLY Numeric Values");
obj.value="";
obj.focus();
return false;
}else if(tmpval>=minval && tmpval <= maxval){
return true;
}else{
alert("This is not a valid Radix number");
obj.value="";
obj.focus();
return false;
}
}
</script>
<form name="form1" action="">
<input size="6" name="Radix" onChange="check(this,this.value);" value="" maxlength='6' style='font-family: arial; Color: white; font-size: 12; font-weight: bold; background: steelblue;'>
<input type="submit" value='' name="B1" id=b1 style="background-image: url('../images/search.gif'); height: 21px; width: 78px">
</form>