- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
While testing, I am experiencing an exception behaviour oddity on a runtime mandatory setting of a text field depending on which check-box a user selects...
I have two mutually-exclusive check-boxes, House and Appartment, plus a text-field named Floor.
If the user selects House, then I disable the mandatory and visibility settings of the Floor field. The opposite if the user selects Appartment...I want them to enter a Floor value in that case.
The scripts against a Click Event on the House and Appartment check-boxes, are as follows:
House:
this.resolveNode("Floor").rawValue = null;
this.resolveNode("Floor").mandatory = "disabled";
this.resolveNode("Floor").presence = "invisible";
Appartment:
this.resolveNode("Floor").presence = "visible";
this.resolveNode("Floor").mandatory = "error";
xfa.host.messageBox("Please enter the floor number on which the appartment is located", "Floor", 3);
When I test the form it's fine, except when trying the scenario where a user selects Appartment and then selects House, instead. Two messages are displayed...the first as in the code above (which is intended), followed by a mandatory field ERROR message saying the "Floor cannot be blank" before the user has had a chance to enter a value into the Floor text-field.
I would expect the ERROR message to appear if the form is submitted without a value being entered in Floor, but not BEFORE the user has an opportunity to do so.
How can this second message be prevented from appearing at this point ?
Whilst this may seem trivial in this simple example, I will have similar more complex rules to provide for in my development.
Any ideas would be appreciated. Thank-you
Guy
Views
Replies
Total Likes