0

I have a contact form set up with Freeform and when having inline errors, I would like to return to an anchor on the page, since my form is on the bottom of the page.

I tried setting inline_error_return="#contact-form", but it doesn't even add the hash to the url.

Hope someone can help me out.

1 Answer 1

2

I think inline_error_return is the way to go, but maybe you need a complete url there, not just the anchor. In a recent site I did, I have inline_error_return="{page_url}/#job-apply-form" which works.

2
  • Yes, you need the URL or segments as well as the anchor in inline_error_return="", eg. inline_error_return="template_group/template#anchor". Keep in mind that the page is reloaded with the inline errors, so the anchor behaviour is a bit different from the classic way of clicking a link going to an anchor on the same page.
    – Solspace
    Jan 28, 2014 at 17:50
  • A really late addition - You can use inline_error_return="{current_url}/#anchor" too. Handy if your form is outside the channel entries loop.
    – SamC
    May 30, 2014 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.