Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » Mollom error message too far down the page - users don't see it

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1165 Views
  • jodamo5
    Avatar
    Community Member
    9 Posts

    Mollom error message too far down the page - users don't see it Link to this post

    Hi. The contact form I am using Mollom on is down the bottom of a page.

    When someone enters an incorrect captcha entry, the page is reloaded back to the top of the page. So our users think the form has sent, because they don't see the error message (which they have to scroll down to see).

    Is there a way I can set an anchor on the page so that mollom will always jump to that anchor?

    I contacted the guys at Mollom and they said it would need to be referred to the Silverstripe team.

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Mollom error message too far down the page - users don't see it Link to this post

    Yes this is SS issue rather than mollom. The redirection back down to the form on error is part of the core (The mollom validator simply returns pass or fail) so it doesn't handle any redirecting.

    If you set $form->redirectToFormOnValidationError(true); it will redirect the user back down to the form. Using that line should work fine in your custom forms. If your using the UserForms module you can't set that property from the CMS so you might have to edit the module.

  • jodamo5
    Avatar
    Community Member
    9 Posts

    Re: Mollom error message too far down the page - users don't see it Link to this post

    Hi Will. Thanks for the speedy reply. I am using UserForms, so it sounds like I'll have to edit the module.

    So which file (and where in the file) do I insert this line?
    $form->redirectToFormOnValidationError(true)

    Thanks heaps.

  • bennettpr
    Avatar
    Community Member
    37 Posts

    Re: Mollom error message too far down the page - users don't see it Link to this post

    This should be:

    $form->setRedirectToFormOnValidationError(true);


    Paul

  • jodamo5
    Avatar
    Community Member
    9 Posts

    Re: Mollom error message too far down the page - users don't see it Link to this post

    Thanks for that correction Paul. Can you please tell me which file that line should be inserted in? And where in the file?

    (I am using the "User Forms" module to run the forms if that makes any difference).

    thanks!
    Josh

    1165 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.