Omitting drop down lists if a certain drop choice is chosen

Avatar

Avatar

sbower01

Avatar

sbower01

sbower01

28-11-2011

I have 5 drop down lists that have data binding to populate a text field with number values (12-34-567-89012-34).  There is one choice in the first drop down list that will populate the entire numbered sequence.  If that drop down choice is chosen, I would like the next 4 drop downs to be skipped.  How can I do this?

Thank you,

Steve B

View Entire Topic

Avatar

Avatar

Steve_L_Walker

Avatar

Steve_L_Walker

Steve_L_Walker

28-11-2011

Something like this should work.

The attached form has three drop-downs (dd1, dd2 and dd3) each with a default value of "00". On dd1 exit event I check if "01" was chosen. If so I set dd2 and dd3 access to "protected" and their values to "00".

// form1.page1.subform1.dd1::exit - (JavaScript, client)

if (form1.page1.subform1.dd1.rawValue == "01") {

          form1.page1.subform1.dd2.access = "protected";

          form1.page1.subform1.dd3.access = "protected";

          form1.page1.subform1.dd2.rawValue = "00";

          form1.page1.subform1.dd3.rawValue = "00";

}

else {

          form1.page1.subform1.dd2.access = "";

          form1.page1.subform1.dd3.access = "";

}

The text field tf calculate event checks dd1. If dd1 is "01" is sets tf to "12-34-56". If dd1 is not "01" it concantenates dd1, dd2 and dd3.

// form1.page1.subform1.tf::calculate - (JavaScript, client)

if (form1.page1.subform1.dd1.rawValue == "01") {

          this.rawValue = "12-34-56";

}

else {

          this.rawValue = form1.page1.subform1.dd1.rawValue + "-" +

                    form1.page1.subform1.dd2.rawValue + "-" +

                    form1.page1.subform1.dd3.rawValue;

}

Steve