I adapted this from an example provided by pguerett call "sanity-check" (in another thread that I can't seem to locate right now) which performed a similar function based on a checkbox.
I have a drop down menu with a change event to set focus the a text menu IF the dropdown item is changed to "other".
In the text field I have an exit event that "should" give a popup msg then set focus back to the dropdown field, IF the dropdown item is "other" AND the field is null on exit.
However, this is not working as planned.
Any assistance would be greatly appreciated.
Thanks.
Solved! Go to Solution.
Views
Replies
Total Likes
Part of it is getting your "=" and "==" mixed up. One = to assign value, two == to compare a value.
I think the attached does what you need.
I changed your script to:
var newValue = this.boundItem(xfa.event.newText);
if (newValue == "Other")
{
xfa.host.setFocus(form1.IncidentReport.OtherNature);
}
I think the way it works is that you have to specifically capture value selected from the dropdown, because it's just been selected the value doesn't exist in the field yet...or something like that - someone else here can probably explain it properly!
Views
Replies
Total Likes
Part of it is getting your "=" and "==" mixed up. One = to assign value, two == to compare a value.
I think the attached does what you need.
I changed your script to:
var newValue = this.boundItem(xfa.event.newText);
if (newValue == "Other")
{
xfa.host.setFocus(form1.IncidentReport.OtherNature);
}
I think the way it works is that you have to specifically capture value selected from the dropdown, because it's just been selected the value doesn't exist in the field yet...or something like that - someone else here can probably explain it properly!
Views
Replies
Total Likes
Thanks for clarifying the "=" / "==" issue.
This works perfectly. I also added an IF script to the exit event of the drop field to assist in ensuring that "other" was doesn't remain selected if the user leaves the explaination text field blank.
Thanks for the help!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies