Avatar

Level 5

Hi all,

I'm using the script below to force numbers only for a phone number field, but it allows the user to press the parentheses and dash characters into the field, perhaps related to auto-fill on the field.  Is there any way of preventing this?


if (xfa.event.newText.match(/[^0-9]/)) {


  xfa.event.change = "";


}