How do i get Choice field value in onchange client script?

Balaji3
Kilo Contributor

Hi Experts,

Can you pls suggest me how do i get choice field (Technologies) value (WCC) in onchange client script.

find_real_file.png

Regards,

Balaji

3 REPLIES 3

Tom Sienkiewicz
Mega Sage

This is a list type of field fromm what I can see so it can store more than one value.

if you do g_form.getValue('your_field_name'), it will give you a comma-separated string of all the selected values in that field. Those would be the sys_ids of the related table records selected in that field.

Tomasz, I need to print 'WCC' in alert in client script.

Abhishek Chavan
Giga Expert

Hi Balaji,

you can use 

var choiceValue = g_form.getValue(<fieldName>); 
var choiceLabel = g_form.getOption(<fieldName>, choiceValue).text;
alert(choiceLabel);

Please mark helpful if it helps

Regard,
Abhishek Chavan