Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: MikeGTS on Jul 10th, 2011  |  syntax: HTML  |  size: 3.70 KB  |  hits: 110  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  5.   <title> - jsFiddle demo</title>
  6.   <script type='text/javascript' src='http://code.jquery.com/jquery-1.6.js'></script>
  7.   <script type="text/javascript" src="jquery.cookie.js"></script>
  8.  
  9.  
  10.  
  11.   <script type='text/javascript'>
  12.   //<![CDATA[
  13.  $(window).load(function(){
  14.  
  15.    $("#parent2, #parent3").css("display","none");
  16.    $(".aboveage2").click(function(){
  17.  
  18.        if ($('input[name=age2]:checked').val() == "Yes"){
  19.                         $("#parent3").slideUp("fast"); // HIDE
  20.            $("#parent2").slideUp("fast"); // HIDE
  21.                         $("#parent0").slideDown("fast"); // SHOW
  22.            $.cookie('showTop', 'collapsed'); //Add cookie 'ShowTop'
  23.        }
  24.        
  25.        if ($('input[name=age2]:checked').val() == "No") {
  26.            $("#parent2").slideDown("fast"); // SHOW
  27.            $("#parent3").slideUp("fast"); // HIDE
  28.                         $("#parent0").slideUp("fast"); // HIDE
  29.            $.cookie('showTop', 'expanded'); //Add cookie 'ShowTop'
  30.        }
  31.        if ($('input[name=age2]:checked').val() == "Maybe") {
  32.            $("#parent3").slideDown("fast"); // SHOW
  33.            $("#parent2").slideUp("fast"); // HIDE
  34.                         $("#parent0").slideUp("fast"); // HIDE
  35.            $.cookie('showTop', 'expanded3'); //Add cookie 'ShowTop'
  36.        }
  37.  
  38.     });
  39.        var showTop = $.cookie('showTop');
  40.                
  41.        if (showTop == 'expanded') {
  42.        $("#parent2").show("fast");
  43.                 $("#parent0").hide("fast");
  44.                 $('input[name=age2]:checked');
  45.                 } else {
  46.        $("#parent2").hide("fast");
  47.                 $('input[name=age2]:checked');
  48.       }
  49.            
  50.             if (showTop == 'expanded3') {
  51.        $("#parent2").hide("fast");
  52.                 $("#parent3").show("fast");
  53.                 $("#parent0").hide("fast");
  54.                 $('input[name=age2]:checked');
  55.            }
  56.  
  57.            
  58.            
  59.  
  60.  });
  61.  //]]>
  62.   </script>
  63.  
  64. </head>
  65. <body>
  66. <fieldset>
  67. <ol class="formset">
  68.         <li><label for="fname2">First Name: </label>
  69.     <input type="text" id="fname2" value="" name="fname2"/></li>
  70.         <li><label for="lname2">Last Name: </label><br />
  71.     <input type="text" id="lname2" value="" name="lname2"/></li>
  72.         <li><label for="email2">Email Address: </label><br />
  73.     <input type="text" id="email2" value="" name="email2" /></li>
  74.         <li><label for="age2">Are you above 21 yrs old?</label><br />
  75.     <input type="radio" name="age2" value="Yes" class="aboveage2" /> Yes
  76.     <input type="radio" name="age2" value="No" class="aboveage2" /> No
  77.     <input type="radio" name="age2" value="Maybe" class="aboveage2" /> Maybe</li>
  78. </ol>
  79. <ol id="parent2" class="formset">
  80.         <li><strong>Parent/Guardian Information:</strong></li>
  81.         <li><label for="pname2">Parent Name: </label>
  82.     <input type="text" id="pname2" value="" name="pname2"/></li>
  83.         <li><label for="contact2">Contact No.: </label><br />
  84.     <input type="text" id="contact2" value="" name="contact2"/></li>
  85. </ol>
  86. <ol id="parent3" class="formset">
  87.         <li><strong>Info for Maybe Answer:</strong></li>
  88.         <li><label for="pname2">Parent Name: </label>
  89.     <input type="text" id="pname2" value="" name="pname2"/></li>
  90.         <li><label for="contact2">Contact No.: </label><br />
  91.     <input type="text" id="contact2" value="" name="contact2"/></li>
  92. </ol>
  93.  
  94. <ol id="parent0" class="formset">
  95.         <li><strong>4444444444444</strong></li>
  96.         <li><label for="pname2">Parent Name: </label>
  97.     <input type="text" id="pname2" value="" name="pname2"/></li>
  98.         <li><label for="contact2">Contact No.: </label><br />
  99.     <input type="text" id="contact2" value="" name="contact2"/></li>
  100. </ol>
  101.  
  102.  
  103. <input type="submit" name="submit" value="Submit" class="submitbtn" />
  104. </fieldset>
  105.  
  106.  
  107. </body>
  108.  
  109.  
  110. </html>