Let’s take a look at how to do that with a text field that is only supposed to have a value of either ‘AAAA’ or ‘BBBB’ (yes, I know that this does not make much sense in a real PDF form).So, if the user enters ‘01234’ we should see an error message that would instruct the user about what type of data is valid for this field.In that case, the previous value of the field is restored, and the user has to enter the data again.
To learn more about the event object, take a look at JS.88.560– make sure to click on the button in the upper left corner to display the navigation pane if it’s not shown automatically.
In the latter case, we set rc to false, and also display an error message.
When you play around with the function, you’ll notice that the validation function is only called when the focus leaves the field, so you have to click outside of the field to actually make that error message pop up.
Is there any quick fix that I can do to the code above to make it work in Netscape?