Hi, > I have two forms with same id like the case shown below
You can't do that, it's invalid HTML. IDs must be unique: http://www.w3.org/TR/html401/struct/global.html#adef-id You could give them the same *name* (although I wouldn't recommend it because of browser bugs), but not *id*. In your code, I'd just go with neither a name nor an ID and access them via their parent: var params = $('second').down('form').serialize(); HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Feb 18, 12:20 pm, Hari <[email protected]> wrote: > I have two forms with same id like the case shown below > > <div id="first"> > <form id="samename"> > <input id="xyz"/> > ..... > </form> > </div> > > <div id="second"> > <form id="samename"> > <input id="xyz"/> > ..... > </form> > </div> > > when i do serialization of samename form under first it serializes > both forms > $$('#second #samename').first().serialize(); > > and the serialized output had > xyz - ['form1value','form2value'] > > can i avoid this somehow..... moreover > $$('#second #samename').first() should give me element associated with > second form alone.. why does it serialize first form... > > Regards, > Hari -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
