views:

38

answers:

0

hi im saw this jquery script: http://jquery.bassistance.de/validate/demo/ and i want also the posibility to show a field when a button is checked but not with a checkbox. but with two radiobuttons. if radiobutton1 is checked, display field1 and if radiobutton2 is checked display field 2 what do i have to change..?

 <script type="text/javascript">
$().ready(function() {
 //code to hide topic selection, disable for demo
 var foo = $("#foo");
 // foo topics are optional, hide first
 var inital = foo.is(":checked");
 var topics = $("#blaat")[inital ? "removeClass" : "addClass"]("gray");
 var topicInputs = topics.find("input").attr("disabled", !inital);
 // show when foo is checked
 foo.click(function() {
  topics[this.checked ? "removeClass" : "addClass"]("gray");
  topicInputs.attr("disabled", !this.checked);
 });
});
</script>
<form class="cmxform" id="signupForm" method="get" action="">
 <fieldset>
  <p>
   <label for="foo">De checkbox dus veranderen naar 2 radio buttons</label>
   <input type="checkbox" class="checkbox" id="foo" name="foo" />
            <!--  
            <input type="radio" value="ding" class="checkbox" id="foo" name="foo" />
            <input type="radio" value="dong" class="checkbox" id="foo" name="foo" />
            -->
  </p>
        <!-- Fieldset 1 -->
  <fieldset id="blaat">
   <label for="topic_marketflash">
    <input type="checkbox" id="topic_marketflash" value="marketflash" name="topic" />
    Marketflash
   </label>
   <label for="topic_fuzz">
    <input type="checkbox" id="topic_fuzz" value="fuzz" name="topic" />
    Latest fuzz
   </label>
   <label for="topic_digester">
    <input type="checkbox" id="topic_digester" value="digester" name="topic" />
    Mailing list digester
   </label>
  </fieldset>
  <!-- -->
        <!-- Fieldset 2 -->
  <fieldset id="andere">
   <label for="topic_marketflash">
    <input type="checkbox" id="topic_marketflash" value="marketflash" name="topic" />
    Voor
   </label>
   <label for="topic_fuzz">
    <input type="checkbox" id="topic_fuzz" value="fuzz" name="topic" />
    Beelden
   </label>
  </fieldset>
        <!-- -->        
 </fieldset>
</form>