I have a form that I have created two drop down menus. The first drop down menu is a Identification for a subject being taught the second is what part of the lesson is being taught. Based on the selection of drop down box 1 and drop down box 2 I would like it to auto populate how many hours was taught based on what item was selected in drop down box 1 and 2. There is 43 lessons listed in drop down box and each lesson is divided differently in course material and length. Is there a java script I could input in to calculate the hours based on those selections? Any help would be greatly appreciated. Thank you
Drop Down Box 1 selected Drop down box 2 Selected Hours taught
Changing a Tire Learning Step Activity 3 1.4
Drop Down Box 1 selection changed to Drop down box 2 Selection changed to Hours taught
Changing engine oil Learning Step Activity 2 1.1
Is there a way using java to create this function and if so any help with creating it would be greatly appreciated. Thank you
The basic structure for such a code would be the following:
var v1 = this.getField("Drop Down Box 1").value; var v2 = this.getField("Drop Down Box 2").value; event.value = ""; if (v1=="Changing a Tire" && v2=="Learning Step Activity 3") event.value = 1.4; if (v1=="Changing engine oil" && v2=="Learning Step Activity 2") event.value = 1.1;
You would place this code as the custom calculation script of the "Hours Taught" text field.
Worked perfectly Thank you very much I was racking my brain for days on this. You sir are a legend in my eyes.