I have a set of 3 radio buttons. If #1 is selected then a subform with one text field is displayed. When displayed that field is required. All of that works fine. What doesn't work is if the user selects #1 then decides to select #2 instead, the subform correctly is "hidden" but the field is still seen as required. I'm not sure how to fix this. Here's the script:
//Create a variable to hold the document object
var v1 = form1.page3.accessApps.TextField11.rawValue;
//accessApps
if
((v1 == "") || (v1 == null) )
{
xfa.host.messageBox( "Please list the applications the associate should have access to" );
xfa.host.setFocus("form1.page3.accessApps.TextField11");
}
Solved! Go to Solution.
Views
Replies
Total Likes
You would just add the line to the script you are using to show/hide the subform or field.
if (x)
{
FieldName.presence = "visible";
FieldName.mandatory = "error";
}
Views
Replies
Total Likes
You can turn the required setting on and off with the following:
FieldName.mandatory = "error"; //mandatory
FieldName.mandatory = "disabled"; //not mandatory
Views
Replies
Total Likes
Where would these go in the script(s) and on what event?
Thanks,
Margaret Dawn
Views
Replies
Total Likes
You would just add the line to the script you are using to show/hide the subform or field.
if (x)
{
FieldName.presence = "visible";
FieldName.mandatory = "error";
}
Views
Replies
Total Likes
Thanks
Margaret Dawn
Views
Replies
Total Likes
Here's how I inserted the lines in my script:
if
(this.rawValue == 1)
{
accessApps.presence
= "visible";
xfa.host.setFocus("form1.page4.accessApps.TextField11");
form1.page4.accessApps.TextField11.mandatory
= "error"; //mandatory
}
else
{
accessApps.presence
= "hidden";
form1.page4.accessApps.TextField11.mandatory
= "disabled"; //not mandatory
}
but it's not working.
Views
Replies
Total Likes
Hi,
I would recommend that you place the mandatory line of script BEFORE the presence line. See here: http://assure.ly/hxHupW.
Niall
Views
Likes
Replies
Views
Likes
Replies