jquery - How to add the hyphen in html textbox? -


i use following code create textbox enter phone number in run time .how add hyphen(-) in between phone numbers.for example if type 1234567 entry should show 123-45-67 how this? how in jquery?

<input id="abcd" type="text" value="" style="width:220px"> 

you have use javascript this. think this starting point... bottom line is, though, have scripting this. (basically, when field changed, check if it's right amount of #s, , add hyphen if necessary.)

i recommend jquery this; a quick google turns useful results.

keep in mind phone numbers different parts of world hyphenated differently. usa, example, uses +x-xxx-xxx-xxxx, while argentina uses +xx-xx-xxx-xxxx. european countries use +xxx-xxxx-xxxx.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -