0

I am trying below code in Rhodes application. On selecting "title" it should check the respective "Gender". I tried below code but its not working.

<fieldset data-role="controlgroup" data-type="horizontal" class="title">
    <legend>Title</legend>
    <input name="title" id="radio-choice-h-2a" value="Mr."  type="radio">
    <label for="radio-choice-h-2a">Mr.</label>
    <input name="title" id="radio-choice-h-2b" value="Mrs." type="radio">
    <label for="radio-choice-h-2b">Mrs.</label>
    <input name="title" id="radio-choice-h-2c" value="Ms." type="radio">
    <label for="radio-choice-h-2c">Ms.</label>
</fieldset>
<fieldset data-role="controlgroup" data-mini="true" class="gender">
    <legend>Gender</legend>
    <input name="gender" id="radio-choice-v-6a" value="Male" type="radio">
    <label for="radio-choice-v-6a">Male</label>
    <input name="gender" id="radio-choice-v-6b" value="Female" type="radio">
    <label for="radio-choice-v-6b">Female</label>
</fieldset>

I am using below script:

<script>
    $(document).ready(function() {
        $('#radio-choice-h-2a').change(function() {
            alert("in radio chenge")
            if($('#radio-choice-h-2a').is(':checked')) {
                alert("in radio Mr. is checked")
                $('#radio-choice-v-6a').prop("checked", true);
            }
        });
    });   
</script>
diiN__________
  • 7,393
  • 6
  • 42
  • 69
Ashwini
  • 11
  • 6

0 Answers0