Thanks Karl, Klaus and Gordon. I will try the approach and let u know. The reason i have duplicate ID tables is due the fact that.. my 1st table is a template table (this is hidden). On click of a button, i add tables dynamically (using the 1st table as a template) to the page (using DOM + js). Hence i end up with multiple tables with duplicate id's. Is there a better way to approach this scenario then ( i guess you might say, while creating the table dynamically modify the table ID.. did not want to do this processing unless its absolutely necessary ) ?
I guess using class might be another good try for me. Thanks Samant On Mar 3, 5:07 am, Gordon <[EMAIL PROTECTED]> wrote: > IDs are supposed to be, by definition, unique. They are there so that > scripting languages and CSS style rules can easily identify single > elements. If your markup has more than one element with the same ID > in it, then your markup is broken. If you have more than one element > that needs to have the same appearance or behaviour then they should > all be given the same class instead. > > On Mar 2, 7:32 pm, Samant <[EMAIL PROTECTED]> wrote: > > > > > hi, > > > I have 2 questions here for the group.. > > > 1. Does Jquery have native functions or lib or plugins to support > > conversion of HTML Table data into XML string ( which can then be > > sent via AJAX to server for getting a respone) ? > > > 2. If my html page has tables with same ID , how can i obtain a > > handle to all these tables. Eg. there is html page with 3 tables of > > which 2 tables have same id. > > Can i get a handle to these tables using any method like > > alert($('#Instructions').length); > > This however give me length as 1 instead of 2 . > > > I tried using (IE only solution) > > document.all('Instructions').length which works fine , but this does > > not work if there is only 1 id . eg. > > alert(document.all('UserData').length); > > > Any help is appreciated !! > > > sample code > > ----------------------------- > > > <table id='Instructions' border="1" cellpadding="0" cellspacing="1" > > > <tbody> > > <tr> > > <td style="text-align: left; width:25%; vertical-align: > > top"> > > Table 1 > > </td> > > <td style="text-align: left; vertical-align: top"> > > <input name="enter" /> > > > </td> > > </tr> > > > </tbody> > > </table> > > > <table id='Instructions' border="1" cellpadding="0" cellspacing="1" > > > <tbody> > > <tr> > > <td style="text-align: left; width:25%; vertical-align: > > top"> > > Table 2 > > </td> > > <td style="text-align: left; vertical-align: top"> > > <input name="enter" /> > > > </td> > > </tr> > > > </tbody> > > </table> > > > <table id='UserData' border="1" cellpadding="0" cellspacing="1" > > > <tbody> > > <tr> > > <td style="text-align: left; width:25%; vertical-align: > > top"> > > Table 3 > > </td> > > <td style="text-align: left; vertical-align: top"> > > <input name="enter" /> > > > </td> > > </tr> > > > </tbody> > > </table> > > > TIA for reading this- Hide quoted text - > > - Show quoted text -