Tag Archives: CSS

17Nov/12

Javascript function to check if a field input contains letters and numbers only

// Function to check letters and numbers function alphanumeric(inputtxt) {  var letterNumber = /^[0-9a-zA-Z]+$/;  if((inputtxt.value.match(letterNumber))   {    return true;   } else   {    alert(“message”);    return false;   }   } To get a string contains only letters and numbers (i.e. a-z, A-Z or 0-9) we use a regularRead More…