Thursday 15 May 2014

Change radio checked with label -



Change radio checked with label -

i have problem code works if set label not work advice?

this code work;

<script> function seleziona(idradiochk) { $("#"+idradiochk).attr('checked',true); }; </script> <fieldset data-role="controlgroup"> <input type='radio' name='radiocam' id='radiochoice2525' value='2525' /> <input type='radio' name='radiocam' id='radiochoice2524' value='2524' /> <input type='radio' name='radiocam' id='xxradio-choice-1066' value='xx1066' /> </fieldset> <a onclick="seleziona('radiochoice2525');" href="javascript:;">clicca</a>

this code not work

<script> function seleziona(idradiochk) { $("#"+idradiochk).attr('checked',true); }; </script> <fieldset data-role="controlgroup"> <input type='radio' name='radiocam' id='radiochoice2525' value='2525' /><label for='radiochoice2525'>a</label> <input type='radio' name='radiocam' id='radiochoice2524' value='2524' /><label for='radiochoice2524'>b</label> <input type='radio' name='radiocam' id='xxradio-choice-1066' value='xx1066' /><label for='xxradio-choice-1066'>c</label> <input type="radio" name="radiocam" id="radiocam2" checked="checked" value="0" /><label for="radiocam2">d</label> </fieldset> <a onclick="seleziona('radiochoice2525');" href="javascript:;">clicca</a>

without label work whit label not work... thought how solve?

radio-button

No comments:

Post a Comment