Hello mates.., i have contact details page for my users in US, When entering the phone numbers we must format it as (923)-634-1234. It should automatically insert the necessary hipens and parantheisis). i would like to achieve this in the js any ideas please help me friends. Would be Great full to your help, thanks
Hello Jan, its working great thanks a lot....!!!!! But i have once more doubt.., if i click submit button then in the database it will stores only the digits or it includes the braces ?
It depends on server side script (PHP, ASP, JAVA etc.). Server side script receives value from a form and communicates with database and should know datatype of the column in database. This is important, because if you have e.g. bigint datatype, you cant store in it non numeric characters. For performance reasons, searching in database, index using, it should be fine to have int or bigint datatype. You can easily format 9236341234 into (923)-634-1234 format in PHP. It is not a good idea to do input verification at client side only. Do it also in server side to avoid database injection. If you need help, feel free to contact me via PM.