I have one textbox for phone number. My phone number should be XXX-XXX-XXX like this format.
I got the solution for XXX-XXX-XXX format, but i don\'t know how to modi
Since you're using jQuery you can try jquery masked-input-plugin.
There's a jsFiddle for you here where you can see how it works.
The source code for the project on GitHub can be found here.
The implementation is more than simple:
HTML:
javascript:
$("#ssn").mask("999-999-999");
UPDATE:
Another good one can be found here.