add option in client script

jobin1
Tera Expert

On load of sc_req_item i need to add one option in the state field which is already available in the choice list and is disabled for now for some reason so will  the below code will work for adding it back ?

 

g_form.addOption('state','104');

10 REPLIES 10

Hi @jobin1 ,

 

In addOption()  method there is 4th parameter which accepts index i.e. position of the option, you can use it to arrange it, below the format:

g_form.addOption("field_name", "option_value", option_name", "option_index").

 

I hope this helps.

 

Regards,

Kamlesh