Code Snippet posted by:
Puneet20884 | Posted on: 2/28/2010 | Category:
JavaScript Codes | Views: 2122 | Status:
[Member]
|
Alert Moderator
Sometimes we need the automatic comma or semicolon insertion in the textbox say you get the multiple mobile numbers from user as input,
you want a comma after every 10 characters.
The code goes as :
function insert_comma()
{
var str=document.Form1.txtABA.value;
if(str.length%10==0 && str.length!=0)
document.Form1.txtABA.value=document.Form1.txtABA.value+",";
}
Best Regards,
Puneet Sharma - Infosys
Pune, India