Hi-
I am rebuilding Chronoforms7 forms in Chronoforms8. I have a form that has different submit actions depending on the button clicked:
- TCPDF download
- Email user (this happens in 2 different places, sending out a different email depending on the button clicked)
- Upload file
- Update form
In Chronoforms7 I had a different page for each submit type and indicated the appropriate page for each submit button. In Chronoforms8, that is not how it works. I saw a forum post where PHP Events were used, but I don't think I am doing it properly, because no matter whether I just have a check for one submit button and create one event in the PHP action or include all the buttons and create a different event for each button I check, I keep getting NULL returned for the PHP action, therefore no Event is triggered.
Can you please tell me how to have multiple different submit buttons on a form each with different actions assigned to them?
Thanks.
Okay.
- For TCPDF download, I created the file on load of the form and stored it, and then created a HTML download link using the HTML Content View.
- Upload file and Update form is the same action: Save Data. So I just used the main submit action for these.
The only thing I have left is the two email actions. I am not sure how to go about doing this. Can I create a Submit button in a HTML Content View and specify the value for submit to another page? Anyone have a clue how to identify a page in a form in short code in Chronoforms8?
Hi kgriffin
Here is how to do this:
- Disable the Auto next page setting in your form
- add multiple pages with different features
- Add multiple submit buttons with different names in your form page
- in the "Submit" area of your first page, add a PHP action with Events behavior
- Setup multiple events based on your buttons, your PHP code should check which button name is set in the $this->data array and return an event name
- in each event you should use a "Set next page" action to direct your form to that page