Rai Yawar Ijaz

blog

  Home  |   Contact  |   Syndication    |   Login
  6 Posts | 3 Stories | 11 Comments | 34 Trackbacks

News

Article Categories

Archives

Post Categories

var mydata=document.SignUP.txtZip.value;//here the name of the form is “SignUp” and name of the text field on which i want to enforce numerical characters is “txtZip“

 for(var i=0;i < mydata.length;i++)

 {

               var mydigit = mydata.charAt(i);

               if(mydigit < "0" || mydigit > "9")

                          {

                                   alert('Please Enter a Numeric value');

                                    document.SignUP.txtZip.focus();

                                    return false;

                            }

 }

posted on Friday, November 12, 2004 3:53 PM