-
AuthorPosts
-
January 30, 2017 at 9:45 pm #740427
Dear Support,
I’ve done some searching on this topic here in the support forum, and, while I see some have had similar trouble, I haven’t yet found an answer, so I’m hoping you can help.
Basically, I have the Gravity Form here.
The form is located at the bottom of the page in a Color section with the ID #form.
If someone fills out the form, but doesn’t fill in all the required fields, the page refreshes to the top of the page, instead of anchoring where the form starts… and this makes it seem like the form has been successfully submitted.
I contacted Gravity Form support and they gave me the following answer:
This is issue is caused by your theme setup. You can confirm this by switching the site to a default WP theme (e.g. Twenty Sixteen) to test it. There are two workarounds that you can try:
1. Enable AJAX on the form. If you don’t know how to do it check this doc page: https://www.gravityhelp.com/documentation/article/embedding-a-form/#shortcode-builder
2. Use the following filter hook to disable the anchor by having the function return false, or you can return the pixel distance the page should scroll.
See the following page of the documentation for usage examples: https://www.gravityhelp.com/documentation/article/gform_confirmation_anchor/
PHP code usually goes in your theme functions.php file, check the following link for more details: https://www.gravityhelp.com/documentation/article/where-do-i-put-this-code/#php
If you don’t want to edit the functions.php file of your theme, you can create a custom functions plugin, you can see a tutorial of how to do it here: http://justintadlock.com/archives/2011/02/02/creating-a-custom-functions-plugin-for-end-users
If none of the above helps, you will need to contact with your theme support for further assistance (the fixed header is often the cause for this issue, you can also try to disable it if your theme allow it).
So, I can’t use the AJAX option because I have installed the reCAPTCHA.
I added the following filter hook to the function.php file, but it doesn’t seem to have any effect:
/* Gravity Form fix for form anchor */
add_filter( ‘gform_confirmation_anchor’, ‘__return_true’ );Might you have any suggestions on what could be done? Any and all insight you might provide would be much appreciated.
Cheers,
Tim
- This topic was modified 7 years, 9 months ago by hypergolica.
January 30, 2017 at 10:47 pm #740438Hey hypergolica!
I do not think we are the best fit.
It can be a lot better, if you discuss with a freelancer and hire him to help you out.
We hope you do understand.Thanks a lot
Cheers!
BasilisJanuary 31, 2017 at 1:47 pm #740615Dear Basilis,
I am shocked by such an unhelpful response, especially given the information I provided and the ubiquitous use of Gravity Forms.
I had imagined it would be in the interest of the Enfold community to have an available solution for this. My mistake.
Regards,
Tim
February 4, 2017 at 7:43 am #742685Hey!
I’m sorry about that but we don’t usually provide support for third party plugins as stated on our support policy. Anyway, I checked the page above, submitted the form, the page refreshed and it scrolled back to the contact form because an anchor link has been created.
<a id="gf_13" class="gform_anchor"></a>
The hash “gf_13” has been added to the url. Did you add this container as a solution to the issue?
Cheers!
IsmaelMarch 9, 2017 at 10:53 pm #758610So glad I found this thread, I was struggling with this issue also– the links Tim provided above from Gravity Forms have great info, but they were missing a key step.
Here’s a summary of the full fix that worked for me for forms using text confirmations with ajax enabled in the form settings (it won’t solve Tim’s issue since he can’t use ajax, but it works if you are using ajax):
1. Add the following to your child theme functions file to turn on confirmation anchors for Gravity Forms:
// add gravity forms confirmation anchor
add_filter( ‘gform_confirmation_anchor’, ‘__return_true’ );2. Set the placement of the anchor by adding a codeblock on the page where you want the confirmation to appear with the code Ismael gave above– I used
<a id="gf" class="gform_anchor"></a>
because it was not for a specific form, and I put it just above the textblock that contains the Gravity Form shortcode, because I want it to appear where the form was.3. If needed, you can adjust spacing above/below the confirmation text in the text editor by inserting code to add 100px whitespace above the confirmation text, and 40px whitespace below it– here’s the code for 100px whitespace, adjust the value of height to increase or decrease it:
[av_hr class='invisible' height='100' shadow='no-shadow' position='center' custom_border='av-border-thin' custom_width='50px' custom_border_color='' custom_margin_top='30px' custom_margin_bottom='30px' icon_select='yes' custom_icon_color='' icon='ue808' font='entypo-fontello' custom_class='']Hope this helps someone else who needs this fix.
Cheers!`
March 11, 2017 at 5:18 am #759244 -
AuthorPosts
- You must be logged in to reply to this topic.