addOption() in client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2022 02:50 AM
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]);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2022 02:58 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2022 03:49 AM
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.