Monday 24 June 2013

Validation for Mobile text Field by JavaScript


<script>
function Validate()
        {
           
            var y =document.getElementById("y").value;
 
            if(isNaN(y)||y.indexOf(" ")!=-1)
            {
              alert("Enter numeric value")
              return false;
           }
           if (y.length>10)
           {
                alert("enter 10 characters");
                return false;
           }
           return true;
        }
</script>

No comments:

Post a Comment