Can the page reload down where the form is upon submit?

philraymond 24 Nov, 2012
I show a thanks message upon form submit, but the problem is that the form is way down the page, so the thanks message shows up way down the page.

Is there a way for the page to reload down where the form is, using the html 'a name' attribute or something?

Thanks,
Phil
GreyHead 24 Nov, 2012
Hi Phil,

You could use a Joomla! System message (if your template supports them) instead of a Thank You Message action. That will always show at the top of the page. Or you can redirect to a thank you article. Or you could add some JavaScript on the page to detect the Thank You message and reset the focus (not hard but may not be the best approach).

Bob
philraymond 24 Nov, 2012
Thanks, the system message works great.

Can I add a system message when the recaptcha fails? I tried adding one to the Check ReCaptcha OnFail but it goes to an error 100 page outside of Joomla (screenshot attached).

Phil
GreyHead 25 Nov, 2012
Hi Phil,

There was another thread about this yesterday. It looks as though the System Message action is coded to show a full system error like this rather than a red bar at the top of the page. You can use a Custom Code action to get just the message part:
<?php
$mainframe->enqueuemessage('Message here', 'error');
?>

Bob
philraymond 25 Nov, 2012
Thanks, but that's not doing anything (form is at bottom of this page: http://www.smilinggardener.com/academy ).

How is the message supposed to be displayed? Does it depend on my theme to support the functionality?

Thanks,
Phil
GreyHead 25 Nov, 2012
Hi Phil,

Yes, it depends on your template supporting the display of Joomla! system messages.

You may also need to add one more line to load the Joomla! app, though usually that is already loaded:
<?php
$mainframe =& JFactory::getApplication();
$mainframe->enqueuemessage('Message here', 'error');
?>


Bob
philraymond 25 Nov, 2012
Thanks - turned out I had an apostrophe within my error message that caused the problem.
This topic is locked and no more replies can be posted.