I have a form with phone number field, i need to validate it with the format on keypress. How to do this?
It will be like, some one enters a special characters except ( ) - or alphabet then and there it should show an alert, and if numeric digits are entered then it should get auto formatted like (999)-999-9999.
Can anyone help me how to do this in jquery or javascript??
Edit
I used this code below for jquery mask plugin
$(#myid).mask("(999)-999-9999",{placeholder:" "});
placeholder is used to replace the "_" underscores with blank. This works perfectly now.