Trying to run the form again

MattLG 24 Sep, 2013
I have a form in a module position asking for an email address and a captcha. If you user uses this form, it goes through fine and they get the success message (or error message). But, it has redirected to the current page with some extra query string parameters: ?chronoform=FormName&event=submit

This means that if a user then immediately uses any other form on the page (for example, to log in) the form tries to run again and they get the captcha error message.

It's not a major issue because the login (or whatever) still works fine, but the error message is confusing for visitors.

One way around it is to have a redirect to '?' as the last event, but this means that the success message is not shown.

Are there any other workarounds for this?

MattLG
RobP 24 Sep, 2013
Hi Matt,

I Put a custom element in the On Submit task with a redirect code:
<?php
  $app =& JFactory::getApplication();
  $app->redirect(JURI::root().'index.php/where you want to go');
?>


I got this code from Bob and it works great.

Rob
GreyHead 28 Sep, 2013
Hi Matt,

You can add a message to the $app->redirect if your template supports Joomla! System Messages.
<?php
  $app =& JFactory::getApplication();
  $app->redirect(JURI::root().'index.php/where you want to go', 'Thank you for submitting the form');
?>

Bob
This topic is locked and no more replies can be posted.