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