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.

  1. give class attribute radiobuttons.
  2. add "on click" event on class.
  3. check clicked radio button's value in event
  4. 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

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -