How can I have a message that pops up when the second instance of a dropdown option is selected?

The three dropdown fields are:
GLS1 with options: "None", "Grant", "Loan", "Scholarship"
GLS2 with options: "None", "Grant", "Loan", "Scholarship"
GLS3 with options: "None", "Grant", "Loan", "Scholarship"

Only ONE "Loan" is available per academic year, so depending on the random order that the FIRST "Loan" option is selected, I need to have a pop-up message occur when a second "Loan" option is clicked on, thus preventing the option to be selected and active.

Scenario:
A student clicks on the "Grant" option in GLS1 field.

THEN, the student clicks on the "Loan" option in GLS2 field.

THEN, the student clicks on the "Loan" option in GLS3 field BUT receives the following message:

"A student can only have ONE Federal Direct Unsubsidized Student Loan per each Academic Year"

The message would pop up in any order combination of the GLS# fields when the second INSTANCE of when the "Loan" option is selected.

I have been struggling with the 'app.alert' routine but cannot seem to make the eventual outcome as desired. Thanks for any directional assist in advance!

P.S. Each of the GLS# fields already have an existing Validation script (to hide other boxes when the "None" option is selected).


John Forest


Voted Best Answer

You would need to add additional code for those validation scripts. For example, the script for the third field would be something like this:

if (event.value=="Loan" && (this.getField("GLS1").value=="Loan" || this.getField("GLS2").value=="Loan")) {
    app.alert("A student can only have ONE Federal Direct Unsubsidized Student Loan per each Academic Year");
    event.rc = false;
}

Just adjust the field names of the other fields in the first line of the code above to use it in the other two fields.

.


Visit my custom-made PDF scripts website: http://try67.blogspot.com
Contact me personally: try6767@gmail.com


By Gilad D (try67)   


Please specify a reason: