Hi,
I have a site with a form in the footer on every page (module). It works perfectly on all the pages with the exception of the contact page, which has another form on it.
When the footer form is submitted on that page, the thank you message is displayed in the component space rather than in the module form space, and the contact form is not displayed.
Both forms function correctly and don't cross-submit.
Is there a way to tell Chronoforms where to place the thank you message?
Thanks in advance
Keith
I have a site with a form in the footer on every page (module). It works perfectly on all the pages with the exception of the contact page, which has another form on it.
When the footer form is submitted on that page, the thank you message is displayed in the component space rather than in the module form space, and the contact form is not displayed.
Both forms function correctly and don't cross-submit.
Is there a way to tell Chronoforms where to place the thank you message?
Thanks in advance
Keith
Hi Bob,
thanks for that, I think it's got me going in the right direction, however something's not quite right. I've modified the code slightly to allow for two forms on one page. There was some wierdness going on with the persistance of the setting in the session array. So my code is:
For the check, in a custom server side validation:
And in the onSubmit Event:
I've attached a screen shot of my onLoad event structure so that you can see when I've gone with this.
However, what seems to be happening is that there is a '1-click' delay when a form is submitted, so when the form is complete and the submit button click, the form is blank, but if I click the enu item for the form page the flag is set correctly and the thank you message is shown. However when clicking the menu item the flags (cf_submitted_x) should always be set to 0.
Hope this makes sense and you can offer some more help.
Many Thanks
Keith
thanks for that, I think it's got me going in the right direction, however something's not quite right. I've modified the code slightly to allow for two forms on one page. There was some wierdness going on with the persistance of the setting in the session array. So my code is:
For the check, in a custom server side validation:
<?php
$session =& JFactory::getSession();
$form_id =& $form->form_details->id;
print 'cf_submitted_'.$form_id;
$check = $session->get( 'cf_submitted_'.$form_id);
if ( $check == 0 ) {
return false;
} else {
$session->set( 'cf_submitted_'.$form_id, 0);
return true;
}
?>
And in the onSubmit Event:
<?php
$session =& JFactory::getSession();
$form_id =& $form->form_details->id;
$session->set( 'cf_submitted_'.$form_id, '1' );
?>
I've attached a screen shot of my onLoad event structure so that you can see when I've gone with this.
However, what seems to be happening is that there is a '1-click' delay when a form is submitted, so when the form is complete and the submit button click, the form is blank, but if I click the enu item for the form page the flag is set correctly and the thank you message is shown. However when clicking the menu item the flags (cf_submitted_x) should always be set to 0.
Hope this makes sense and you can offer some more help.
Many Thanks
Keith
Hi Keith,
Looking through it the code looks to be OK - but you may be getting a problem with the $check == 0 line as this will be true in more cases than you might expect. Try using $check === 0 or $check === false - or, possibly better, use a string value in place of the boolean one.
Bob
Looking through it the code looks to be OK - but you may be getting a problem with the $check == 0 line as this will be true in more cases than you might expect. Try using $check === 0 or $check === false - or, possibly better, use a string value in place of the boolean one.
Bob
This topic is locked and no more replies can be posted.