for example if you bind something to that ID only the first one will work. so yeah i suggest either using classes or even prefixing the id so you can access them all with 1 selector $("div[id^=prefix_]") this is also similar to the valid CSS to style it (using selectors- but unfortunately it wont work in IE 6 and maybe not even in 7 cant rememver)
On Sep 29, 11:02 pm, Donkeybob <[EMAIL PROTECTED]> wrote: > XHTML standards based development states that the id attribute must be > unique. So if you want you pages to have valid markup, use the class > attribute. > > from w3c: > --------------------------------------------------------------------------------- > id = ID > The id attribute assigns an identifier to an element. The value of > this attribute must be unique within a document. > > http://www.w3.org/TR/xhtml2/mod-core.html#adef_core_id > --------------------------------------------------------------------------------- > > On Sep 29, 3:03 pm, Amardeep <[EMAIL PROTECTED]> wrote: > > > HI Donkeybob > > > can u please tell me what do u mean by invalid page ? r u saying it wont be > > a valid HTML page ?? > > > On Mon, Sep 29, 2008 at 10:26 PM, Donkeybob <[EMAIL PROTECTED]> wrote: > > > as far as I know . . multiple id's is not allowed and would make your > > > page invalid. > > > > On Sep 29, 11:40 am, ♫ cheskonov <[EMAIL PROTECTED]> wrote: > > > > 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> > > > -- > > Amardeep Sarkar