• Resolved terry777

    (@terry777)


    When this plugin is enabled, after the user submits the form, and the page is reloaded, instead of the form remaining in the same position, it starts from the top of the form, which hides the message that tells the user it was successful, or if there was an error. Because it is a long form, displaying it from the top hides the bottom. I started this thread over on the Contact Form 7 forum, not realizing it was this plugin that was doing it, so I’m copying the information to here.

    I have a long form. After I click submit, the page scrolls up so that the Response Message Box is no longer visible, so the user doesn’t see the message “Thank you for your message. It has been sent.” or the error message if there is one. It doesn’t scroll all the way to the top, so I can’t reposition the message box there. It scrolls about midway, so that top of the page is not visible, and neither is the bottom where the success or error message is. Is this normal behavior, or does it normally stay in the same position after the submission?

    I noticed that after submission, the id “#wpcf7-f4851-p4853-o1” is added to the page’s address. Is that what’s making it reposition? If so, why? 4851 is the number of the form, 4853 is the page’s number, although I’m using pretty permalinks.

    So, my address changes from https://www.mysite.com/testwp2/membership/free-membership/ to https://www.mysite.com/testwp2/membership/free-membership/#wpcf7-f4851-p4853-o1 (“mysite” is not the actual name).

    So, in looking at the source code of the page, I see where it has created an anchor tag that is used to redirect (see the form action statement). It’s just that it puts it in a place that forces the page to reposition so the message box cannot be seen. This source code is taken from Chrome, although the problem exists in Firefox.

    <div role=”form” class=”wpcf7″ id=”wpcf7-f4851-p4853-o1″ lang=”en-US” dir=”ltr”>
    <div class=”screen-reader-response”></div>
    <form action=”/testwp2/membership/free-membership/#wpcf7-f4851-p4853-o1″ method=”post” class=”wpcf7-form” novalidate=”novalidate”>
    <div style=”display: none;”>
    <input type=”hidden” name=”_wpcf7″ value=”4851″ />
    <input type=”hidden” name=”_wpcf7_version” value=”5.0.2″ />
    <input type=”hidden” name=”_wpcf7_locale” value=”en_US” />
    <input type=”hidden” name=”_wpcf7_unit_tag” value=”wpcf7-f4851-p4853-o1″ />
    <input type=”hidden” name=”_wpcf7_container_post” value=”4853″ />
    <input type=”hidden” name=”_wpcf7cf_hidden_group_fields” value=”” />
    <input type=”hidden” name=”_wpcf7cf_hidden_groups” value=”” />
    <input type=”hidden” name=”_wpcf7cf_visible_groups” value=”” />
    <input type=”hidden” name=”_wpcf7cf_options” value=”{“form_id”:4851,”conditions”:[],”settings”:false}” />
    </div>

    This code is in the page above the code for the form.

    It seems that the anchor id created starts at the top of the form and this is what moves the page up. I don’t know if it’s your code, or that of cf7. Do you?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter terry777

    (@terry777)

    Well, for the moment I ended up disabling the PayPal & Stripe Add-on plugin and using Contact Form 7 Redirection to take me to a paypal button instead. If I get an answer here or on the Contact Form 7 forum, I’ll see which works better for me. An advantage of the PayPal & Stripe Add-on plugin is that I don’t have to define the buttons in paypal ahead of time, and there are several of them.

    Plugin Author Scott Paterson

    (@scottpaterson)

    If you go to Contact -> PayPal & Stripe Settings -> Other tab. You can set the redirect method. Redirect method 2 disables the Contact Form 7 JavaScript, which I believe is causing the issue on your site. Please use method 1 and it should fix the problem.

    If it doesn’t fix the problem just let me know.

    Thread Starter terry777

    (@terry777)

    It worked! Thanks! It saves me some effort and time not having to create the buttons on PayPal.

    Is anything else likely to change by changing the redirect method to method 1?

    Plugin Author Scott Paterson

    (@scottpaterson)

    Great, glad it worked.

    Method 1 should work without problems. It’s the standard way of doing things. Method 2 is only there as a backup solution.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Form position after submit’ is closed to new replies.