homepage Welcome to WebmasterWorld Guest from 54.211.73.232
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
form.serialize question
riddleyw

5+ Year Member



 
Msg#: 3971843 posted 11:49 am on Aug 14, 2009 (gmt 0)

I feel like such an idiot...I've worked on what I think is a simple problem for days and am getting nowhere...I would appreciate your help:

I have an html table that displays the contents of a mysql table. Each row has a form with a unique id (form1, form2...) and in each form is the RecordID and a field called "Keep" which is represented by a checkbox. When the user hits the checkbox an updater function is called to update the databse.

Right now the parameters from the form are generated via the prototype serialize method (e.g. $('form1').serialize())

The problem is that each form has a different ID, so this code only works for the first form.

How do I get tell the updater which form to serialize when there are more than one form being dynamically generated?

Is there another way?

 

Arno_Adams

5+ Year Member



 
Msg#: 3971843 posted 12:01 pm on Aug 14, 2009 (gmt 0)

Something like this?

function f(obj) {
$(obj).serialize();
...
}

HTH, Tom

riddleyw

5+ Year Member



 
Msg#: 3971843 posted 1:31 pm on Aug 14, 2009 (gmt 0)

wow...thank you. seriously... i am in your debt

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved