Getting values from Radio Buttons NOT from Service Catalog

Ben_Little
Kilo Contributor

I have a number of forms where I use radio buttons instead of the standard choice lists on a variety of form, from CMDB_CI to incident forms. These are NOT variables coming from any part of the service catalog.
Basically, create a field of type 'choice', then in the dictionary, change the type to radio, change the choice to 'None' gives you something like the attached file.

But how do I query the value that is selected?
g_form.getValue() doesn't return anything on the client side, neither does current.getDisplayValue() on the server side.


Thanks,

Ben

3 REPLIES 3

Masha
Kilo Guru

g_form.getValue('u_test1'); worked for me just fine on demo09.service-now.com (See Attached File)


Ben_Little
Kilo Contributor

ok, that is strange, because on both an OnLoad and onChange Client Script, the getValue never returns anything. In fact, alerting both oldvalue and newvalue onChange of the field, doesn't even fire any type of event, evidently it isn't even seeing the field change as a radio button.

I verified the setup is the same as mine in the dictionary on demo.
Perhaps it was a fix in Aspen, as we have not migrated to that yet.

Lastly, how did you get the JavaScript Executor in your screen shot???


Masha
Kilo Guru

I did create an onChange (you might have seen it) and it DID NOT fire for me as well. I've had similar issue with a decimal field on one of our custom tables and Service Now support wasn't able to figure it out and basically told me that it was a custom table with custom scripts that must have broke it... So I think this would be a valid issue to bring up with Service Now support especially in your case, where you use radio buttons through out.

Java Script Executor: Ctrl+Shift+J and Windows Snipping Tool, is that what you are asking? 🙂