cant quite figure out how to process multiple forms to one processing script.

12 views
Skip to first unread message

Thats Broken

unread,
Feb 2, 2012, 7:47:53 PM2/2/12
to Prototype & script.aculo.us
I have a case where i have a form repeated several times on a page,
the goal is to be able to submit each form independently, using unique
values for each submit button and unique form id's.

However, when I submit the first form, it does what i expect; all
remaining forms dont work.

Is there a way to submit multiple forms to the same processing script
using the same names but unique values on each form input fields?

If this isnt an appropriate forum for such questions, forgive me, a
suggestion on where else to look would be appreciated.

thanks in advance,
-jc

Phil Petree

unread,
Feb 3, 2012, 6:21:08 AM2/3/12
to prototype-s...@googlegroups.com

Mobile phone answer: You can't have multiple forms with the same name on the same page.

--
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 prototype-s...@googlegroups.com.
To unsubscribe from this group, send email to prototype-scripta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.

Victor

unread,
Feb 10, 2012, 4:30:43 AM2/10/12
to prototype-s...@googlegroups.com
1. Element identifiers should be unique, in other words, if any form or field has identifier - it should not repeat in other forms.

2. When submitting form via script, it has option for the name of desired submit button, e.g. for form with two submit buttons:

<form id="formId2">
<input type="submit" name="submitButtonName1" value="1" />
<input type="submit" name="submitButtonName2" value="2" />
</form>

script

$("formId2").serialize({submit:"submitButtonName2"})


will give serialized result as if the second button was pressed.

3. Also you can have single form on page, and many buttons which just trigger form submission explicitly, e.g.

<button onclick="sendForm('submitButtonName3');">Submit 3</button>

Reply all
Reply to author
Forward
0 new messages