I forgot to mention that the code above will not set a radio button to
a selected state.
The only thing that works is to use a set of mutually exclusive
checkbox.
I found code by German Schauger that uses a class on the radio button:
$('.mutuallyexclusive').click(function() {
checkedState = $(this).attr('checked');
$('.mutuallyexclusive:checked').each(function() {
$(this).attr('checked', false);
});
$(this).attr('checked', checkedState);
});
This works very nicely...
On Jun 26, 12:09 pm, pclymer <pc89...@gmail.com> wrote:
> I have a 2radiobuttonsin a jQuery Dialog :
>
> <table>
> <tr>
> <td><input id="ArriveTriggerIgnition" name="ArriveTrigger"
> type="radio" value="ignition"/></td><td>Ignition off at Location</td>
> </tr>
> <tr>
> <td><input id="ArriveTriggerIdle" name="ArriveTrigger"
> type="radio" value="idle" /></td><td>Arrive when Idle for</td>
> <tr>
> </table>
>
> I am setting theradiobutton based on another value before opening
> the dialog:
>
> if (triggerIgnition == "True") {
> $("#ArriveTriggerIgnition")[0].checked = true;
> }
> else {
> $("#ArriveTriggerIdle")[0].checked = true;
> }
>
> I have also tried:
>
> $("#ArriveTriggerIgnition").attr("checked", true); & $
> ("#ArriveTriggerIgnition").attr("checked", "checked");
>
> Is there something in the jQuery Dialog that is blocking this or is my
> syntax simply wrong? Thanks!
No comments:
Post a Comment