|
First let me say first time to this forum , hello all ,and thanks for any future help.
Ok here is the script. ..My zip validation is letting some things get through with alphabetic data, but not all the time..I confused :)
Also once I added this:
form1.zip.focus()
form1.zip.select()
return false
It will not let me move anywere off that field once iv typed anything into it? Now Im confused and trapped :) Iv left out the HTML to try to make it easyer to read...Thanks Much
function checkZip(){
var zip=document.form1.zip.value;
if (zip.length != 5){alert("Invalid Zip Code")
}
for(i=0;i<zip.length;i++){
if(zip.charAt(i)<0 || zip.charAt(i) >9){
alert("Invalid Zip Code")}
form1.zip.focus()
form1.zip.select()
return false
}
return true
}
<form
name="form1"
method="post"
action="mailto:blank@yahoo.com"
enctype="text/plain">
<input type="text"name="zip"size="5"onBlur="checkZip()">
</form>
|
|
|
|
|
|
|
|