Forums

2 submit buttons

emmexx 13 Nov, 2012
I thought I understood everything about this topic. I even remember I did a test last week, but now nothing works. 😟

I added 2 submit buttons to my form, say Save and Draft.
I named them 'my_button' with different id and text.

I read this post where Max wrote that it is possible to check the submit button value.
But when I do that there's no $form->data['my_button'] value.
I checked in the debugger, I added a print_r($form->data) and echo $form->data['my_button'] to the custom server side validation but the submit button value is always missing.
Even firebug doesn't report a my_button value in the Post data window.

What could be wrong with my form?

thank you
maxx
GreyHead 13 Nov, 2012
Hi Maxx,

Please drag a Debugger action into the On Submit event, then post a link to the form so I can take a quick look.

Note: if you are using the Easy Wizard you can turn on Debug on the Others tab.

Bob
emmexx 13 Nov, 2012
I created another test :wink: form with just a text label and a submit button.
On submit I put a debugger.

After submitting firebug reports the input field value and in the dubber output there's a [input_submit_2] => Submit

Then I added a second submit button, same field, different name (Submit2).
After submitting I get:
[input_submit_2] => Submit2

So there must be some problem in my real form between the actions in On Submit.😟

bye
maxx
GreyHead 13 Nov, 2012
Hi Maxx,

I've created a form here with two submit buttons that appears to work OK.

The buttons both have the name my_button, they have different 'Text' settings (this is the value of the button).

Bob
emmexx 13 Nov, 2012
Thank you Bob,

I did the same, as I wrote in my previous post, in a new test form. Same result as your's.
So there must be something wrong in the elements or actions in my form.

The strange thing is that the form submits data correctly, data gets saved in the db.
The only thing that is not working is the management of the submit values.

bye
maxx
GreyHead 14 Nov, 2012
Hi maxx,

Please post a link to the form so I can take a quick look.

Bob
emmexx 14 Nov, 2012

Please post a link to the form so I can take a quick look.



Yesterday I sent the link to your email address.
I had to let some user start testing the form, so I removed the debugger and the custom server side validation action.
Anyway you can submit and check in firebug that there's no submit button sent to the server.

If you want I can put a Debugger in On Submit for a few hours.

Thank you
maxx
GreyHead 14 Nov, 2012
Hi maxx,

I just read the email - I'm still working through the backlog from my trip :-(

Bob
This topic is locked and no more replies can be posted.