I have a drop down list of 8 States applicable to our form. Below the drop down, there is a table of the 8 states and some information that needs to be provided depending on the State selected. Example, if a Contractor does business in Texas, a Business License is not needed for general business, but is needed if specialty contractor such as HVAC, Plumbing, etc. I would like to tailor each message to the state requirements, and possibly require some of the table cells depending on the state licensing requirements/selection.
However, I'm not having much luck in even testing one state. Here is what I have for 'Texas', and basically it gives the message box pop-up no matter what is selected. I have tried using TX and Texas as the == value, as the drop down is the standard 'State' object from the library and I deleted all but 8 states.
Here is where I'm at so far, using JavaScript and this is on the change event of the dropdown. Appreciate any help, thank you.
if (this.rawValue == "Texas")
{
xfa.host.messageBox("If you are a Specialty Contractor in the State of Texas, please enter Business License info in below table", "BUSINESS LICENSE", 3, 1);
}Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
the rawValue has not been set when the change event occurs, this happens when you exit the dropt down first.
To check the selection during the change event you have to use xfa.event.change.
if (xfa.event.change === "Texas") {
xfa.host.messageBox("If you are a Specialty Contractor in the State of Texas, please enter Business License info in below table", "BUSINESS LICENSE", 3, 1);
}
Views
Replies
Total Likes
Hi,
the rawValue has not been set when the change event occurs, this happens when you exit the dropt down first.
To check the selection during the change event you have to use xfa.event.change.
if (xfa.event.change === "Texas") {
xfa.host.messageBox("If you are a Specialty Contractor in the State of Texas, please enter Business License info in below table", "BUSINESS LICENSE", 3, 1);
}
Views
Replies
Total Likes
Perfect, works like a charm, thank you, I'll get there . . .
What do you recommend as the best way to address all 8 states/conditions? In VBA I would use select case or possibly nested if, and would like to know the most efficient way to address in javscript. Thank you again.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies