javascript - Link duplicate radio button forms -
so, want display set of radio buttons several places on page. want state of radio buttons linked, select option on 1 form should select option in forms.
sorry not including examples.
here idea:
<form id="serverform"> <input type="radio" name="@(site.siteid)" class="serverradio" value="all"> <input type="radio" name="@(site.siteid)" class="serverradio" value="ds1"> ds1 <input type="radio" name="@(site.siteid)" class="serverradio" value="ds2"> ds2 <input type="radio" name="@(site.siteid)" class="serverradio" value="is1"> is1 </form> this form going created multiple times dynamically depending on size of loops contained in. want each of these forms act duplicated. clicking option on 1 update all.
- give class attribute radiobuttons.
- add "on click" event on class.
- check clicked radio button's value in event
- compare value other radio buttons (in loop radio buttons), if it's same put attribute "checked" on true
p.s.: share code next time easy code example can provided or full solution.
Comments
Post a Comment