Question
Document JS Function That Compares DD Value and Sets Textfield Value
Ok so here’s where I’m at, this is my first attempt and I've been searching/googling for some time now. Any help would be appreciated.
- Document function named UOM with two parameters, name of drop down and name of a textfield
- I would like the function to get the selected value from the drop down after selection, name of drop down Serv_Type_dd1
- Then compare the value to a string example "Attendant"
- If drop down value is equal to "attendant" I set the text field Value to "Hours", textfield name is Amnt_1_1
- Here's how I'm calling the function: UOM([“Serv_Type_dd1”,”Amnt_1_1”]) within the "On Blur" action of the Serv_Type_dd1.
- I have to do this comparison for 17 drop down boxes containing 25 options each options have a different value in the text box
function UOM(ddvalue,textvalue)
{
var source = this.getField(ddvalue).value;
if(source.value=="Attendant")
{this.getField(textvalue).value = "Hours"}
Else if {this.getField(textvalue).value = 'Null'}
}
