I created a textbox with onpress and onblur events. The Javascript function will format the text to (xx-xxxxx).
<input type="text" id="txtnum"
onblur="javascript:return formatText(this)"
onkeypress="javascript:return formatText(this)">
Function formatText(elem)
{
If(elem!=null)
{
Var str=elem.value;
If(str.length==2)
{
Str=str+"-";
Return true;
}
}
}
After entering a number like 12345678, it is formatted to 12-345678, but the submit button does not work.
If I only enter numbers, then the submit button works fine.
I even tried setting causes validation ="false", but that didn't resolve the issue.