setValue() for a Select Box

Community Alums
Not applicable

I have a Catalog Client Script in a Catalog Item and everything works but the line shown underlined in red in the photo below. I'm trying to get option 1 from a select box to be selected if the user chooses yes for a variable at the top of the form. the showFIeldMsg and other setValues work as expected but nothing happens to the windows_hardware_options select box.  

find_real_file.png

I also tried with the value being '1' instead of just 1 but that didn't help. Here is the variable 'windows_hardware_options' and the first value 'standard_laptop': 
find_real_file.png

 

What am I doing wrong? 

 

1 ACCEPTED SOLUTION

Balaji Jagannat
Kilo Guru

Hi Annie - 

You will have to set it with the value of your selectbox. If the value is numeric, then 

g_form.setValue('windows_hardware_options', 1);

 

If the value is text, then

g_form.setValue('windows_hardware_options', 'standard_laptop);

 

**Mark this response as accepted answer/helpful, based on impact. 

View solution in original post

2 REPLIES 2

Balaji Jagannat
Kilo Guru

Hi Annie - 

You will have to set it with the value of your selectbox. If the value is numeric, then 

g_form.setValue('windows_hardware_options', 1);

 

If the value is text, then

g_form.setValue('windows_hardware_options', 'standard_laptop);

 

**Mark this response as accepted answer/helpful, based on impact. 

Community Alums
Not applicable

Taking out the 1 worked, thank you!! I could have sworn I tried that originally but I guess not. 🙂