The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to hide radio button based on other selection(radio buttons)?

prasannal
Kilo Contributor

I have urgent requirement can any one suggest me.....

find_real_file.png

From the above screenshot,   i need to display only physics in exam while selecting physics in subject

and I have to hide chemistry in exam type.

5 REPLIES 5

Ivano B
ServiceNow Employee
ServiceNow Employee

Hi Prasanna



From your snap shot it seems you are working on the service catalog item form.


Probably I'm wrong but I don't think you can obtain what you want easily with the radio button (multiple choice) field.


The choices are provided and there is no possibility to have dependencies between different variables without using DOM manipulation.


DOM manipulation is a practice discouraged and not recommended by ServiceNow.


I would suggest to use other type of fields to obtain something similar.



Cheers


Gurpreet07
Mega Sage

Why don't you create two different variables with question Exam. One variable with option Physics and another for chemistry.


shloke04
Kilo Patron

Hi,



Below thread would be useful for your requirement:



Hiding Radio buttons


Service Catalog Requirement



Hope this helps.Mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Harsh Vardhan
Giga Patron

Hi Prasanna,



you can hide it but you need to handle with DOM manipulation and that's not a good approach. instead of doing it i would recommend you just dome some changes in designing and change ur catalog form variable type.


check the below screenshot.


citm.png


Create these type of variable that i have highlighted in black color.



citms.png


here i have created a catalog ui policy to hide check box. based on your subject selection the exam option will be available.


citmpolici.png



Final Result



outputcitm.png



Let me know if you have any further question.




Thanks,


Harshvardhan



Please Mark the answer as correct/helpful based on impact.