Custom code on different pages

vismay 24 Jan, 2017
Hello everybody,

I have a form with page switch like in FAQ
https://www.chronoengine.com/faqs/70-cfv5/5255-how-can-i-switch-form-pages-in-cfv5.html

I have a custom code that write fields on database in the on_submit

when I press CONTINUE I go to page_2 where there is another custom code that shall write again to database. ( On page_2 inside event switcher)

this code is not written, I suppose wants to write the first code on_submit.

QUESTION:

is there a possibility inside a custom code or php to say sometthing like:

If you are on first page write this otherwise write that.


Thanks
Max_admin 24 Jan, 2017
Hi vismay,

Pages are events, so you can check the event name:

<?php
if($form->data['event'] == 'first'){
//code
}


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vismay 24 Jan, 2017
Thanks I will try....
vismay 26 Jan, 2017
I don't really mannage, because I'm using an eventi switch ( see attachment)

When I submit the first page (on load) I go to on submit, where I have the eventi switch.

From there I see the URL &event=submit, not page_2
Max_admin 29 Jan, 2017
Hi vismay,

You may also set page 1 to submit to a new event named "switch", and add the event switcher there, then make page2 and 3 submit to "submit".

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vismay 29 Jan, 2017
Thanks, I think I have to project it on paper, in order to organize the switching.
This topic is locked and no more replies can be posted.