troubleshooting Question

Radio button in Javascript and Ajax

Avatar of erikTsomik
erikTsomikFlag for United States of America asked on
Web Languages and StandardsJavaScript
2 Comments1 Solution1672 ViewsLast Modified:
I have 2 radio button with the value Yes and No, When The value is Yes I want to expand additional input form, if No then don't. On the page Load I only need to prompt If the user want to add more info if yes then expanded. I am using mx.foo prototype

function handleSchoolDropdown(field){
                        
                              if((field.checked == 'true' && schoolInfo.el.offsetHeight == 0) || (field.checked != 'true' && schoolInfo.el.offsetHeight != 0))
                                    schoolInfo.toggle();
                        }
                        
                        
                        //-->
                  </script>
            <script type="text/javascript" language="javascript">
                        var ccCitizen;
                        var schoolInfo;
                  
                        window.onload=function () {
                              ccCitizen = new fx.Height ('citHide',{duration:500});
                              schoolInfo=new fx.Height ('schoolsinfo',{duration:500});
                              
                  }
                  
                  
                  </script>
            My HTML is here
 <div class="aaprowindent">
                              <span class="labelindent"><label for="MoreSchools">Add More Schools</label>
                              </span>
                           
                             <span class="formwindent">
                              <label for="MoreSchools1">Yes</label>
                  
                  <input name="MoreSchools1" type="radio" id="MoreSchools1" value="yes" class="form" checked onchange="handleSchoolDropdown(this)"/>
            <label for="MoreSchools2">No</label>
           
            <input name="MoreSchools1" type="radio" id="MoreSchools2" value="no" class="form" onchange="handleSchoolDropdown(this)"/>
                  </span>
                        </div>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros