Custom Code in on Submit

paulsmithx 31 Mar, 2013
Hi there,
I have the following structure in a form embedded in an article:
On Submit:
    Check Captcha:
         On Success:
                Custom Code
                Email User
                Email webmaster

The two emails are arriving correctly but the custom code is not working. It Just returns to the page in which the form was embedded. The code follows (I've replaced the actual url of course):

(Mode = View)

<h2>Your Basic Program Enquiry</h2>

<p> 
An email confirming your enquiry has been sent to the email address you have provided. </p>

<p>Click <a href="http://www.chronoengine.com">here</a> to browse the site.
<br/>
<br/>
<br/></p>


Any help as to why this happening will be greatly received. Has it perhaps something to do with the form being embedded within an article?
Many thanks
Paul
paulsmithx 31 Mar, 2013
I've just tested with the Front End View option from the backend and can confirm that the custom code is firing. It appears then to be something to do with the form being embedded in an article.

Please help....

We are on J 2.5.8
And cf V4 RC 3.0 (site) and 4.0 RC 3.4.1 (admin)

Regards,
Paul
GreyHead 31 Mar, 2013
Hi PaulSmith,

I'm not clear what your Custom Code is or what it is supposed to do. You have posted some HTML here - but that looks like the Email Template?

Bob
paulsmithx 09 Apr, 2013
No, it's not an email template. It's html to display a message to the user on the site. The (mode=view) is the option in the form - it's not actually in the code.

The rest of it is pretty straightforward html.

I don't beleive this is an html problem - as I mentioned it works find when I call the front end view, it fails when I embed the form in an article.

Regards,
Paul
GreyHead 09 Apr, 2013
Hi Paul,

Sorry, I misunderstood. Please see this FAQ

Bob

PS In general I avoid adding actions to the On Success boxes, you get a cleaner layout if you put them after the previous action instead.
paulsmithx 09 Apr, 2013
There we are. That did the trick.

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