If you are using the change event, you need to bear in mind that the event fires BEFORE the user's input has registered in the object's .rawValue.
Either use xfa.event.newText instead of this.rawValue OR move the script to the clcik event (where this.rawValue is appropriate).
I haven't checked the script - too late,
This script does what i want, i just need to add the verify "age" field thing.
I am surprised you are getting the script to work where you are using .rawValue in the change event.
In any case, if you can to test the age field, then you have a couple of choices.
- You can incorporate it into the existing if/else statement, by using a && to create an "and" condition.
- You can extend the existing if/else statement with an else if(). For example, if()/else if()/else.
- Or you can create a completely separate if/else statement after the first one (eg in the same event).
Hope that helps,