Conditional display of elements based on radio button selected

120 views
Skip to first unread message

Srikanth Vissarapu

unread,
Mar 7, 2014, 9:29:03 PM3/7/14
to jquery...@googlegroups.com
Hi,

I am able to build html based on json passed from server. 

However my requirement is to add some conditional logic also with html elements like showing a div with elements based on radio button selected from radio button group.

For example, we have two radio buttons in a group and when first button is selected i need to show a text box and when 2nd radio button is selected a check box need to be displayed. Can you please guide me in right direction on how to build the json so as to achieve this functionality.

Please help me with the same.

Thanks,
Srikanth

daff

unread,
Mar 9, 2014, 6:16:34 PM3/9/14
to jquery...@googlegroups.com
This sounds more like something you'd do directly with jQuery after the form has been created (like you would with any other form).
So create the full form and show/hide certain section based on the selected checkbox.

Srikanth Vissarapu

unread,
Mar 9, 2014, 10:41:06 PM3/9/14
to jquery...@googlegroups.com
Hi Daff,

Thanks for the reply. Yeah writing JQuery with in jsp would need manual interaction and need to know the form id element details in UI. I am just check if there is way to provide this conditional logic with in JSON so dform takes care of it in UI. Plesae let me know if there is any such feature.

Thanks,
Srikanth
Reply all
Reply to author
Forward
0 new messages