PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Reposition the submit button on form error

  1. Hey gang,

    I've re-positioned my form submit button using the following CSS:

    .gform_image_button {
    	float: right;
    	position: absolute;
    	right: 3px;
    	bottom: 40px;
    }

    The button is right where I want it but, if the user submits the form with an error, the error messages will cause the button to overlap some form fields. (I'm using AJAX forms, btw.)

    Below is the solution I came up with, which doesn't work. I've placed this script in my HEAD section. I'm hoping you folks can spot what I'm doing wrong...

    <script type="text/javascript">
    jQuery(document).ready(function($) {
    	// On form validation error, adjust the position of the submit button to prevent overlapping
    	$(document).bind("gform_post_render", function(){
    		tooltip_form_error();
    	});
    	function tooltip_form_error(){
    		if( $(".validation_error").length > 0 ) {
    			$(".gform_image_button").css("bottom","0px !important");
    		};
    	}
    });
    </script>
    Posted 8 years ago on Monday October 24, 2011 | Permalink
  2. Can you post a URL to your form so we can take a look at it? That would help a bit.

    Posted 8 years ago on Tuesday October 25, 2011 | Permalink
  3. Hey Kevin,

    Here is a link to the development site: http://buccan.mynewsitepreview.com/

    Forms appear inside of tooltips when you hover over certain links in the footer. Try hovering over the 'Contact' link and just hitting the submit button without filling out the form, and you'll notice two problems:

    1) The form tooltip resizes off the bottom of the page; and
    2) The submit button overlaps form fields because of the error boxes.

    I can resolve both issues using jQuery to animate the tooltip when it is resized and reposition the submit button, if I can just bind my error handling function to this darn gform_post_render hook...

    Thanks in advance!

    Posted 8 years ago on Tuesday October 25, 2011 | Permalink
  4. Still stuck on this...just wanted to be sure you got my reply.

    Thanks again!

    Posted 8 years ago on Friday October 28, 2011 | Permalink
  5. Sorry, didn't see your reply. It's real late here so I'll look at it fresh for you in the AM and see what I can offer.

    Posted 8 years ago on Friday October 28, 2011 | Permalink
  6. If you want to bump up to the 1.6 Release Candidate version you can take advantage of the new "gform_post_render" hook available for AJAX forms.

    http://www.gravityhelp.com/documentation/page/Gform_post_render

    The RC is stable and the 1.6 final is scheduled for release at the first of next week. You can grab it from the downloads page if you want to give it a shot.

    Posted 8 years ago on Friday October 28, 2011 | Permalink
  7. Ah, that explains it! I didn't realize gform_post_render was a new feature, not yet available in 1.5.x...

    I'll grab 1.6 and give it a go as soon as it's available. Thanks for your help.

    Posted 8 years ago on Saturday October 29, 2011 | Permalink
  8. Thanks for the update.

    Posted 8 years ago on Saturday October 29, 2011 | Permalink

This topic has been resolved and has been closed to new replies.