hi
Besides the standard "form load" & "form submit" I would like to run another event ("submit 2").
I can add the event and run it but the actions are not run correctly.
For example: in default "form submit" actions like "DB_save" and "email" work fine, but when I copy paste the same actions into the new event("submit 2"), they run but they don't save anything to database and email fields are empty.
Any ideas?
thanks
Hi ttomljen,
There is technically no difference between the standard On Submit event and one you Add yourself so the actions should behave identically. Have you set them up correctly? For example the Email action is disabled by default?
Bob
thanks for a quick reply:
yes, I set them correctly, the second event ("submit 2") works OK in the sense it sends the email and makes a database record, but they are both empty(does not save records from the form).
Default submit normally saves into the database.
could it be because I trigger "submit 2" by making a menu which triggers event from "submit 2", is that the correct way to do it?
I also tried to add to the default form link plus "&event=submit2", but the result is the same.
Hi ttomljen,
Do you have a space in the event name? It needs to be submit2 or submit_2, not submit 2
Bob
the "submit 2" was just an example for easier communication, the event itself is called "close".🙂
the problem is not in the triggering of the event, the problem in "db_save" is the data is saved with empty values, and the same thing for "email".
I will send you link(via. P.M.) to the form, so you can check the debug, or I can give you admin access, if that will be required.
thanks
Hi ttomljen,
Thanks for the link. It looks as though you are using an SEF URL for the link - I suspect that may not be submitting to the event at all. In any case a button with a link on it won't submit the form data. It needs to be a proper submit button to so that (or a button input of type submit).
You can see what is being submitted from your browser web developer tools.
Bob
if I understand you correctly: the submit button I wrote manually won't work, so if I add the default submit button from elements, how to get it to trigger another event (for example in my case: event "close"), because by default, it will trigger "submit"?
thanks again
Hi ttomljen,
You can have more than one Submit button in a form and then check which one was used to submit the form. There are several ways to do this:
a) By checking the Value submitted for the button.
b) By giving the buttons array names like name='submit_btn[a]' and checking the key value after submission. This is useful if you want the same text shown on both buttons (i.e. the values are the same).
c) By using button inputs of type='submit' when you can assign values that are different to the text displayed on the button.
Bob