Forums

Event Switcher - 2 Submit Buttons

Gatsman 08 Jul, 2016
Hi i am trying to add a quick save with the event switcher but can't get it done.

I got 2 buttons in my form that will define the Quick Save and continus edit or Save and Close:

<div>
	<button name="savebutton" id="savebutton" type="submit" value="quicksave" data-load-state="">Quick Save</button>
</div>

... Form Fields ...

<div>
	<button name="savebutton" id="savebutton" type="submit" value="save_close" data-load-state="">Save - Close</button>
</div>


And in the Event Switcher i have this code:
Events success,fail
<?php
if ( $form->data['savebutton'] != 'quicksave' ) {
  return 'success';
} else {
  return 'fail';
}
?>


I what the event switcher cases to work as redirects.
My Setup structure is as follows:
On submit
- Update Database
- Event Switcher
- Custome Code - Redirect - Quick Save *
- Custome Code - Redirect - Save and Close *
* (redirect links are double checked and are correct)

But no matter what button i click i always get fail = Save and Close
Anyone can see what i am doing wrong?
Gatsman 08 Jul, 2016
Answer
This was an issue with hidding the buttons from a Load JS that i have in order to display a loading message.
This topic is locked and no more replies can be posted.