onChange Client Script is not working

Jen11
Tera Expert

I have the following form:

Jen11_0-1741802812810.png

What I am trying to do is, when 'Operational work type' is selected, I would like to 'Work category' to to populate as well.  I have the following client script, but it is not working:

 

Jen11_1-1741803007072.png

Am i missing something?  Please help! 

 

1 ACCEPTED SOLUTION

Since your custom field that you're trying to set is on the task table, not resource plan, use:

g_form.setValue('task.u_work_category', '4');

View solution in original post

6 REPLIES 6

Brad Bowman
Kilo Patron
Kilo Patron

Hi Jen,

Verify that the selected value (not text/label) of the choice field is 'admin', and your custom field name and value are correct.  You can add an alert on newValue to verify that the if condition is satisfied.

Toderean alexan
Tera Contributor

Hello @Jen11 ,

 Did you print the value of "Operational work type", add this line of code before the if condition, 

g_form.addInfoMessage("Value of work-type: "+newValue);

 

 

Jen11
Tera Expert

i double checked and everything is correct:

 

Jen11_0-1741803522924.png

 

Jen11_1-1741803597097.png

 

Since your custom field that you're trying to set is on the task table, not resource plan, use:

g_form.setValue('task.u_work_category', '4');