Forums

Chronoforms v5 two submit buttons on one page

estorus 16 Oct, 2014
Hello. I using multipage form. I want to do on first page two button to chose, each one has different way to pages (first to page2 and second to page3) how to do it?
[attachment=0]Untitled.png[/attachment]
GreyHead 16 Oct, 2014
1 Likes
Hi estorus,

In the Form On Submit event you can use an Event Swtcher, add a little PHP to detect which submit button was uses then redirect the user to the appropriate page.

Bob
estorus 16 Oct, 2014
What little PHP do I need? =)))
GreyHead 16 Oct, 2014
1 Likes
Hi estorus,

What is the HTML for your two submit buttons?

Bob
estorus 16 Oct, 2014
<div class="form-group gcore-form-row" id="form-row-button19"><div class="gcore-input gcore-display-table" id="fin-button19"><input name="button19" id="button19" type="submit" value="Далее" class="form-control A" style="" data-load-state="disabled" /></div></div>
and
<div class="form-group gcore-form-row" id="form-row-button20"><div class="gcore-input gcore-display-table" id="fin-button20"><input name="button20" id="button20" type="submit" value="Далее" class="form-control A" style="" data-load-state="disabled" /></div></div>
estorus 16 Oct, 2014
I don't understand how to do it 😟
Max_admin 16 Oct, 2014
In the "Event switcher" and based on your buttons names:

<?php
if(!empty($form->data["button19"])){
  return "first";
} else if(!empty($form->data["button20"])){
  return "second";
}
?>

And here is how the event switcher works:
http://www.chronoengine.com/faqs/70-cfv5/5212-event-switcher.html

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.