Regular expression for validating numbers only
Regular expression pattern in Java always is the best method to validate an user’s phone number.Here i provide a regex pattern to determines if the phone number is in correct format, the pattern force starting with 3 digits follow by a “-” and 7 digits at the end.It happens sometimes, when user forgets to choose option from the select feild.
function text Alphanumeric(inputtext, alert Msg) // Function that checks whether the input characters are restricted according to defined by user.So, just to make sure that user entered the email address in the correct format, it’s necessary to include email validation code inside the validation codes.A general expression to check valid email address is: /^[w-. [a-z] : It matches characters from lowercase ‘a’ to lowercase ‘z’. If by mistake, user skips entering any detail, soon the alert message appear on the form. escaping - by -) [0-9] : It matches digital number from 0-9. That means, you could be very sure about the form, whether users have entered the details or not.
Validation codes will return an alert message, if it finds some empty fields in the form.