I am using jquery validator plugin when i type us code on my page i need to generate hyphen automatically after 3 digit, the jquery code that I am currently using is and it allow only when use enter mobile number in this format(000-000-0000)
customphone: function(value, element) {
return this.optional(element) || /^\d{3}-\d{3}-\d{4}$/.test(value);
},
But the problem is i manually type the hyphen but and i want to generate that hyphen automatically....Could anyone please help me..