newbie: redirect after submit

bz3x 12 Oct, 2010
I know this is a simple question, so simple that I haven't been able to find an answer on the forums...

My form has e-mail verification (it works), writes data to the DB (it works) and sends me an e-mail notification when a user has verified the submission (also works).

After the user clicks "submit", I'd like to redirect them to a page that says "thanks, you'll receive a verification request." This isn't exactly a confirmation page because it should appear _after_ the submit process has been concluded, correct?

I thought that in the "general" section, the field "Redirect URL" was what I'm looking for, but that doesn't seem to have any effect.

Thanks for putting me in the right direction!
ascwash 12 Oct, 2010
Under "Form code"

Choose
On Submit code - after sending email:
(May contain PHP code with tags)

Click on [+/-]

Add
<p>Thanks, you'll receive a verification request.</p>

This will display in the content area of the site, wrapped in your template.

You can add HTML or PHP code to this, however I would assume if you want to control the confirmation page with an article you could use PHP redirect code here.
bz3x 12 Oct, 2010
Thanks for the reply.
Weird, I followed your instructions but don't see the text anywhere on the page. Searching the source of the page I couldn't find any trace of it. All I see is a fresh new form...
Grateful for your help!
ascwash 12 Oct, 2010
Interesting...

What plugin(s) do you have enabled, if any?

Try maybe to:
Unpublish the 'Redirect' plugin under the 'plugin tab'.
Remove the redirect URL from the 'general tab'
.
Example:
Create a new form with one input field and a submit button and the above method works. I also use this on my live sites... so...

It could be you need to undo what you did to try and make it function the way you wanted before you found this answer.
bz3x 12 Oct, 2010
Two plugins are enabled: e-mail verification and recaptcha.

I made a new form as you suggested, with one text field and the submit button, and configured only the e-mail verification plugin. Still: after I press "submit", the form does its POST and I get a fresh form without my <p>thanks!</p> message.

Where in the template is the message supposed to appear? By the way, I'm setting debug to "on" but I'm not seeing the debug information anywhere.

(By the way, the "Redirect URL" on the general tab doesn't affect this issue. I've discovered that it determines where the user gets redirected to after clicking on the verification link. If e-mail verification isn't being used, it determines where the user gets sent to after submitting the form.)
ascwash 12 Oct, 2010
Try removing the redirect URL from the 'general tab'?

Are you using the wizard or doing everything by hand?
I'll assume hand.
Try creating one with the wizard.

Maybe also try creating a form without enabling the email verification plugin and recaptcha to see if there is a conflict.

<jdoc:include type="message" />

Is the message thingy. It should be included in your template where you want the message(s) to appear.
bz3x 12 Oct, 2010
Thanks for your help! Unfortunately there's still something wrong.

I created the new test form using the wizard. I removed the Redirect URL data. No plugins are enabled, and I double-checked that the <jdoc:include type="message" /> tag is in the template, and it is (otherwise even the form wouldn't be visible, I think).

But neither my <p>thanks</p> message nor the debug info is being displayed.

Would be very happy for some insight on this! Thanks again.
GreyHead 16 Oct, 2010
Hi bz3x,

Please post a link to the form so we can take a quick look.

Bob
bz3x 20 Oct, 2010
Thanks for your interest!

The form is found at (url). The test form, with only one field, is at (url). Both forms have the same problem.

Thanks for any leads!
GreyHead 20 Oct, 2010
hi bz3x,

I suspect that there is something happening with the SE URLs. If I try to go to the 'standard' form URL
http://www.example.com/sub_domain/index.php?option=com_chronocontact&chronoformname=testform
the page redirect to
http://www.example.com/sub_domain/component/chronocontact/?lang=en-GB
and I get a message

There is no form with this name or may be the form is unpublished, Please check the form and the url and the form management

The message is correct because there is no chronoformname in the redirected url.

This is probably because there's a problem with the SEF URL settings.

Bob
bz3x 20 Oct, 2010
This is interesting...

I have no special SEF plugins or extensions, but had enabled the three SEO settings in the Joomla! control panel: "SEF URLs", "mod_rewrite", and "add suffix to URLs". For the sake of isolating our variables I've now disabled those. JoomFish however is running, if that makes a difference.

What I've noticed is that the link to the page in the menu is the following:
(url)/index.php?lang=en-GB&option=com_chronocontact&Itemid=8
notice the extra "amp;" twice in the URL: this it seems is what is causing the error message.

When I remove the "amp;"s, the form is shown correctly. However, when I then submit the form, the "amp;"s are back, along with the error message. Why are the "amp;"s being added to the URL?

In case that it's relevant, here is the configuration of the menu item:
[list]
  • ID: 8
  • Title: test
  • Alias: test
  • Link: index.php?option=com_chronocontact
  • From "parameters (basic)": Form name: testform
  • [/list]

    Very appreciative of any light you can shed on this!
    bz3x 20 Oct, 2010
    Got it!

    I discovered that the amp; issue had to do with JoomFish and resolved it.

    The difference between the test form and the real form was that the real form makes use of the "verify e-mail" plugin. So it makes sense that anything I write in the "Form Code: On Submit code - before sending email" or "Form Code: On Submit code - after sending email" won't show up, because the e-mail isn't sent when the form is submitted! It also makes sense that when the e-mail is sent (the user clicks on the link to verify her e-mail), the message finally appears.

    The correct place for the <p>Thanks! You'll receive an e-mail to validate your submission</p> message is in the plugin configuration. OnSubmit code: OnSubmit Before Verification.

    It now works with the Joomla! SEO turned back on too.

    Thanks again for the attention!
    GreyHead 21 Oct, 2010
    Hi bzx3,

    Well found :-) The Email verification plug-in would explain that - it's behaviour isn't always obvious.

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