Link to home
Start Free TrialLog in
Avatar of erikTsomik
erikTsomikFlag for United States of America

asked on

Radio button in Javascript and Ajax

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>
ASKER CERTIFIED SOLUTION
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm glad I could help.  Thanks for the grade, the points and the fun question.

bol