Sterc / FormIt

A dynamic form processing Snippet for MODX Revolution
https://docs.modx.com/current/en/extras/formit
33 stars 58 forks source link

Multiple forms on page not working after upgrading #100

Closed mikegomy closed 7 years ago

mikegomy commented 8 years ago

Hi, I have upgraded to Modx 2.5.1-pl in the last few days. (Not sure if I should report this here or to Modx) Multiple forms on the page worked fine before then. Now the submit buttons no longer work.

I simplified the problem to use just one form on the page. The form definition starts with [[!FormIt? &submitVar=abc ...other stuff.... ]]
The submit button has a name="abc" id="abc" settings.

When I remove the &submitVar=abc (but keep the name="abc" id="abc" ) it works as expected. But when I use &submitVar=abc (as I will for multiple forms) it stops working.

Is there anything new that has to be done for Modx 2.5.1-pl?

Regards, Mike

funkyduke commented 8 years ago

Is your submit a button or an input field? It must be an input field with type="submit" to work properly with &submitVar I think.

joeke commented 8 years ago

@mikegomy It could have something to do with the update in processing of placeholders in the latest MODX version. We've had some strange behaviour as well in 2.5.1 with FormIt. Setting all the FormIt placeholders to uncached [[!+fi.placeholder]] solved the issues for us. Maybe that could work for you too?

kargaved commented 7 years ago

I had the same problem with Multiple forms + ajax, but it's was decided simple: You should to insert to &submitVar the name of hidden field of the form, and not the form submit input name, for example:

<form method="post" action="[[~[[*id]]]]" id="questionForm" data-pjax> <input name="formid1" type="hidden" value="questionForm">

Waivor commented 7 years ago

@joeke I'm using two FormIt calls (Modx 2.5.5.) with input fields and the correct &submitVar values. Everything runs as expected without a recaptcha or math hook . But if you use recaptcha v.1 (which doesn't work at all) or the math hook in both calls it won't work ("Wrong answer" error).

joeke commented 7 years ago

@mikegomy Is this still an active issue or did you resolve it?

mikegomy commented 7 years ago

Hi, I worked around it so it is no longer an issue. thanks.

Best regards, Mike Montgomery Give more than you can afford. Take less than you need. Leave every situation better than you found it.

On 5 September 2017 at 09:30, Joeke Kloosterman notifications@github.com wrote:

@mikegomy https://github.com/mikegomy Is this still an active issue or did you resolve it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Sterc/FormIt/issues/100#issuecomment-327094926, or mute the thread https://github.com/notifications/unsubscribe-auth/AUPSsiS-OJ82EX9TiJfQ7xd5HFenEKpyks5sfPimgaJpZM4JsF2t .