I have multiple submit buttons, such as Preview and Submit. How do I code it to say if I click Preview do this or if I click Submit do that.
I currently have the following set up:
if (HTTP_Request::POST == $this->request->method()):
try
{
$form->values($this->request->post());
}
catch (ORM_Validation_Exception $ex)
{
$errors = $ex->errors('models');
}
endif;
I don't know how to code it to tell it if I clicked the Preview or the Submit button.
Buttons on view page:
echo Form::button('preview', 'Preview', array('type' => 'submit', 'id' => 'preview-button'));
echo Form::submit('submit', 'Submit', array('id' => 'submit-button'));