Hi, i am a new customer in jQuery so the following may sound stupid .. the problem i am facing is as bellow: I am working in a site where i am dealing with multiple forms having same id and every this .. all the forms contain some radio buttons (no of buttons may vary) and one submit button .. now how do i find out which submit button is clicked . all the submit buttons are also having the same id anb everything . any help please :
the html for my page is as follows : <div class="boxcontent" style="padding: 5px; height: 495px;" id="div_poll"> <form action="/effinfunny_beta/node/2015" method="post" id="poll- view-voting"> <div> <input name="nid" id="edit-nid" value="2015" type="hidden"> <input name="current_nid" id="edit-current-nid" value="" type="hidden"> <table border="0" cellpadding="0" cellspacing="3" width="100%"> <tbody> <tr> <td colspan="2"><h2 class="yellow_txt">What's the best version of 'Zelda?'</h2></td> </tr> <tr> <td><span class="fanart" style="margin-bottom: 5em;"> <div class="form-item"> <label class="option"> <input name="choice" value="0" class="form-radio" type="radio"> Legend of Zelda</label> </div> </span></td> <td><span class="fanart" style="margin-bottom: 5em;"> <div class="form-item"> <label class="option"> <input name="choice" value="1" class="form-radio" type="radio"> Majora's Mask</label> </div> </span></td> </tr> <tr> <td><span class="fanart" style="margin-bottom: 5em;"> <div class="form-item"> <label class="option"> <input name="choice" value="2" class="form-radio" type="radio"> Twilight Princess</label> </div> </span></td> <td><span class="fanart" style="margin-bottom: 5em;"> <div class="form-item"> <label class="option"> <input name="choice" value="3" class="form-radio" type="radio"> The Wind Waker</label> </div> </span></td> </tr> <tr> <td><span class="fanart" style="margin-bottom: 5em;"> <div class="form-item"> <label class="option"> <input name="choice" value="4" class="form-radio" type="radio"> Ocarina of Time</label> </div> </span></td> <td><span class="fanart" style="margin-bottom: 5em;"> <div class="form-item"> <label class="option"> <input name="choice" value="5" class="form-radio" type="radio"> The Minish Cap</label> </div> </span></td> </tr> <tr></tr> <tr> <td> </td> <td> </td> </tr> <tr> <td><input name="op" id="edit-vote" value="Vote" class="form-submit legend_polls" onClick="$('#edit-current- nid').val('2015');return false;" type="submit"> </td> <td><div class="form-radios"></div> <input name="form_token" id="edit-poll-view-voting-form- token" value="23b6d81824cd64e8c1e18c75b760f24c" type="hidden"> <input name="form_id" id="edit-poll-view-voting" value="poll_view_voting" type="hidden"> </td> </tr> </tbody> </table> </div> </form> <form action="/effinfunny_beta/node/2017" method="post" id="poll- view-voting"> <div> <input name="nid" id="edit-nid" value="2017" type="hidden"> <input name="current_nid" id="edit-current-nid" value="" type="hidden"> <table border="0" cellpadding="0" cellspacing="3" width="100%"> <tbody> <tr> <td colspan="2"><h2 class="yellow_txt">Best search engine</ h2></td> </tr> <tr> <td><span class="fanart" style="margin-bottom: 5em;"> <div class="form-item"> <label class="option"> <input name="choice" value="0" class="form-radio" type="radio"> google</label> </div> </span></td> <td><span class="fanart" style="margin-bottom: 5em;"> <div class="form-item"> <label class="option"> <input name="choice" value="1" class="form-radio" type="radio"> yahoo</label> </div> </span></td> </tr> <tr> <td><span class="fanart" style="margin-bottom: 5em;"> <div class="form-item"> <label class="option"> <input name="choice" value="2" class="form-radio" type="radio"> msn</label> </div> </span></td> <td><span class="fanart" style="margin-bottom: 5em;"> <div class="form-item"> <label class="option"> <input name="choice" value="3" class="form-radio" type="radio"> AOL</label> </div> </span></td> </tr> <tr></tr> <tr> <td> </td> <td> </td> </tr> <tr> <td><input name="op" id="edit-vote" value="Vote" class="form-submit legend_polls" onClick="$('#edit-current- nid').val('2017');return false;" type="submit"> </td> <td><div class="form-radios"></div> <input name="form_token" id="edit-poll-view-voting-form- token" value="23b6d81824cd64e8c1e18c75b760f24c" type="hidden"> <input name="form_id" id="edit-poll-view-voting" value="poll_view_voting" type="hidden"> </td> </tr> </tbody> </table> </div> </form> </div>