Get display value of select box variable via client script

Eli Guttman
Tera Guru

Hi,

On a requested item form, we have a select box variable.

If i use g_form.getValue() in catalog client script, i get the value instead of display value.

Is there an option to get the display value, something like g_form.getDisplayValue() for client script / catalog client script?

1 ACCEPTED SOLUTION

Aksha
Tera Guru

In client side, you can try by using

var value=g_form.getValue('selectboxName');

 var text=g_form.getOption('selectBoxName', value).text;

 

In server side, you can access it by using producer.variables.selectBoxName.getDisplayValue()

View solution in original post

4 REPLIES 4

rad2
Mega Sage

You could use g_form.getDisplayBox('reference field name')

or use GlideAjax to get the value from script includes

Aksha
Tera Guru

In client side, you can try by using

var value=g_form.getValue('selectboxName');

 var text=g_form.getOption('selectBoxName', value).text;

 

In server side, you can access it by using producer.variables.selectBoxName.getDisplayValue()

Thank you! it works for variables, as long as they are not in read only - which is basically what i needed, but i don't know if it is possible.

 

thanks anyway...

agrawars
Tera Contributor

Tried all above options, but only g_form.getDisplayValue("element_name") worked.