using jquery to disable a series of radio buttons on demand.

Posted by holden on Stack Overflow See other posts from Stack Overflow or by holden
Published on 2010-04-30T00:55:15Z Indexed on 2010/04/30 0:57 UTC
Read the original article Hit count: 312

I'm trying to accomplish something similar to Wikipedia's History history page, dynamically disabling radio buttons in a series.

Ie... if #4 in group two is selected, then 1-4 of group one are disabled, etc.

I know how to disable them individually or as a group, but I'm not sure how to do it in a series of say 1-4:

Individually:

$("#version_history input[id^=versions_2_3]:radio").attr('disabled',true);

or group:

$("#version_history input[id^=versions_2]:radio").attr('disabled',true);

The inputs are named versions_1_X and versions_2_X, X being some number. 1..2..3.. etc.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about radiobutton