addOption() in client script?

Sid_Takali
Kilo Patron
Kilo Patron

Hi all,

I have a Client Script where I am adding Choices through addOption() but when I save the record the backend value is populating instead on Label.  

g_form.addOption('u_available_phone', '10', ans1[0]);

6 REPLIES 6

John Dewhurst
Kilo Guru

It reads as though you are expecting the display value to be honoured on the backend even if it is not a choice entry on the sys_choice table, this will not happen, the display value returned will be whatever is associated with the value in the sys_choice entries for that element.

Community Alums
Not applicable

Please find below 

g_form.addOption('field name', 'value', lable);

g_form.addOption('category', '10', hardware);

If you want to add choice on some condition then you can use this.