Set Value to Lookup Select Box Field From Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 05:12 AM
Hi All,
I have a lookup select box field that I want to populate from a client script (onChange).
I tried using g_form.setValue() but it did not worked.
Does anyone knows why or a different way to do that?
Thanks :))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 05:32 AM
Hi @Snow Tomcal,
It should work while writing the script consider below scenarios:
You will have to set it with the value of your select box. 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');
Regards, Shekhar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 07:43 AM
Hi @Snow Tomcal
If you will set the value based on a script, why do you need a lookup field? You can use a different field type and then use setvalue that you need.
Also if you to help you to see what is missing, add a code line like: alert (g_form.getValue(variablename));
If you can share the full code will be nice to help you.