• Firstly, thank you for the plugin. A lot of work and love has obviously been put in!

    I’ve searched the support forum, and your posts on your own site too, but not found an answer to my following question.

    I have my Sign Up form at the bottom of a page, below the fold. This means that whenever the submit button is pressed, the page reloads and goes right back to the top of the page. This means users don’t see the embedded ‘thank you’ message, nor any validation error messages, unless they think to scroll back down.

    Is there any way that an Anchor can be added to the form, and that page reloads triggered by the form, load the page back at that anchor point, therefore presenting the user with the ‘thank you’ or validation issues without needing to scroll back down?

    I’m more than happy to edit code, but after a quick look I can’t see a way of doing this without guidance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author xnau webdesign

    (@xnau)

    If you understand how page anchors work, this will be pretty easy.

    First, you need to set your anchor. Usually, this will be a heading where you want the page to scroll to, but it can be almost any HTML tag. Let’s say you have the heading <h2>Sign Up Here</h2> right above your signup form. To set the anchor, you give that heading an ID, like this: <h2 id="signup">Sign Up Here</h2>

    That means your anchor is #signup

    Now, you’ll need to use a custom template for your signup form so you can alter the action that is performed when the form is submitted. Read the linked article if you’re not familiar with Participants Database custom templates.

    At the top of your custom template, before the HTML and before the ?> that closes the top PHP section, place this line of code:

    $this->hidden_fields['thanks_page'] = '#signup';

    That will set the signup form to submit and return to the same page, scrolling to the #signup anchor.

    Thread Starter cokeyblokey

    (@cokeyblokey)

    Ah ha! That’s awesome. I was unaware of custom templates for your plugin, but that all makes perfect sense and gives a very simple solution.

    I’ll get this in place shortly, when I return to this particular project.

    Many thanks for the support!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding an anchor to the sign up form’ is closed to new replies.