newcoder1010 Posted October 3, 2016 Share Posted October 3, 2016 Hi, I developed a form. I like to display a class only If I select Yes. Otherwise, by default, class should not be displayed at all. Also, when I click no, class should not be displayed either. If you please help. My page http://webuyhousesinnova.com/?q=coaching Field name is Have you completed any deals in the last 3 years?. If you select Yes, you will see a fieldset displays. The fieldset is functioning correctly. I simply see an empty fieldset when it is either No or by default. I tried to display none. In this case, it never displays. fieldset .panel-body { clear: both; display: none;} Thanks in advance. Link to comment Share on other sites More sharing options...
dsonesuk Posted October 3, 2016 Share Posted October 3, 2016 If the radio buttons are not sibling elements of box element with inputs inside, you can't use css, you will have to use JavaScript. Link to comment Share on other sites More sharing options...
newcoder1010 Posted October 4, 2016 Author Share Posted October 4, 2016 What javascript element I should learn to accomplish this? Can you please point me to some tutorials page? Thanks. Link to comment Share on other sites More sharing options...
dsonesuk Posted October 4, 2016 Share Posted October 4, 2016 http://www.w3schools.com/jsref/prop_radio_checked.asp Use similar code to identify which button is selected and therefore equals true, and transverse to appropriate element to add/remove class to give required result. Link to comment Share on other sites More sharing options...
newcoder1010 Posted October 4, 2016 Author Share Posted October 4, 2016 I used this code for now. It worked. I still have to look at your javascript. Thanks. .webform-client-form-132 .panel-body { padding: 0px; } .webform-client-form-132 .panel-default { border:0px; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now