I have a field on a form that needs to only accept numbers (with no dashes, spaces, commas, etc.) OR accept a specific phrase. In this case "Not Available".
In most cases the user with enter a number. But there are instances where the number is not known, so we want to allow the phrase Not Available to be entered into that field.
Right now, I have this code in the change event
if (xfa.event.newText.match(/[^0-9]/ || /\sNot Available\s/))
{
xfa.event.change = "";
}
It works for only allowing numbers to be typed, but doesn't work for allowing the Not Available to be typed or selected from a drop-down.
I'm not very familiar with these types of expressions, so help is appreciated.
Thanks,
Dave