Hello all!
I am looking for help I have a form where I have two dropdowns. When you choose an item from the first drop down it populates the list for the 2nd dropdown. Problem is when the user decides to change their mind on the first dropdown and the 2nd drop down is already populated the new list appears but the field within the dropdown doesn't clear for the user to make a new choice. How can I get the field to clear?
Here is the script I am using
Thanks!!!
Jodi
Solved! Go to Solution.
Views
Replies
Total Likes
Set the rawValue to "". So: CST.rawValue = "";
You can put that (and the clearItems() line) above the if statement - it has to happen every time so no need to repeat it in each if statement.
Views
Replies
Total Likes
Set the rawValue to "". So: CST.rawValue = "";
You can put that (and the clearItems() line) above the if statement - it has to happen every time so no need to repeat it in each if statement.
Views
Replies
Total Likes
Hi,
I would solve this the following script in the change event of CT dropdown box.
// Arrays with values for CTS dropdown box
var arrayA = ["Student Placement Clinical", "Student Placement Non-Clinical", "Government-Fundend"];
var arrayB = ["Games", "Premium Seating License", "Consession Stands"];
// Function to populate CTS
function populate(arrayName) {
CTS.clearItems();
for (var i = 0; i < arrayName.length; i += 1) {
CTS.addItem(arrayName[i], (i + 1).toString());
}
xfa.host.openList(CTS.somExpression);
}
// Switch function to determine which array to populate in CTS
switch (xfa.event.change) {
case "Affilitation Agreements" : populate(eval(arrayA)); break;
case "Athletic Event Agreements" : populate(eval(arrayB)); break;
}
Views
Replies
Total Likes
Thanks!!! I am going to go with Jono's first to see if it works. Radzmar's is a little more advanced than I have done If I can't get Jono's to work I might be back!
Thanks!!
Jodi
Views
Replies
Total Likes
Jono you are a life saver!!! that worked!!
Thank you so much!
Have a fantastic day!
Jodi
Views
Replies
Total Likes
Hey Radzmar,
Jono's worked! Thanks for taking the time to reply! When i get better at Javascript i might try yours
Thanks!
Jodi
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies