Copy link to clipboard
Copied
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.
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'}
}
Copy link to clipboard
Copied
Have you checked the JavaScript console for errors?
Did you get any pop-up errors when entering your code?
In the "if" statement the alternative is "else" not "Else". Capitalization is important in JavaScript.
I also would use the value of the fields as parameters to the function and have the function return a value that would be used to set the value of the field.
Copy link to clipboard
Copied
I fixed the errors and got the following to work, but I have to pass the cmb box string in and return a string then set the value of the text box, I would like to be able to pass the combobox name in, the textbox name in as string then let the function set the value of the textbox based on the value selected in the combobox.
function UOM(ddvalue)
{
retval = "";
var source = ddvalue;
//app.alert(source,3);
//if (source=="Physical Therapy") { retval = "Visit(s)"; }
//else
if (source=="Other-Specified in Details") { retval = "**Specify**"; }
else if (source=="Intermittent Nursing (LPN)") { retval = "Visit/or Hours"; }
else if (source=="Nutrition or Feeding") { retval = "Case(s)"; }
else if (source=="Adult Companion Care") { retval = "Hour(s)"; }
else if (source=="Underpads") { retval = "Package(s)"; }
else if (source=="Transportation-Add On") { retval = "Trip(s)"; }
else if (source=="Medication Administration") { retval = "Visit(s)"; }
else { retval = ""; }
return retval;
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now