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.

Two forms one one page

  1. ragnarok
    Member

    Bit of a newbie question I'm sure, but I couldn't find a similar topic.

    I currently have two forms on a single page see: http://www.thehivelewes.co.uk/?page_id=9
    as you can see the header of the 'sign up' form appears to be bold, and the alignment seems to be out. (This is seen when compared to other pages)

    What is the best way to resolve this?

    Thanks,

    Posted 14 years ago on Friday May 20, 2011 | Permalink
  2. The difference is that on the page with the form in the body, the default Gravity Forms styles are loaded and applied. On pages where it's just the form in the header, the styles aren't loaded because they're not being enqueued because you're using the function call to embed the form outside of the WordPress loop.

    When embedding a form via a function call you must also manually include the necessary Gravity Forms related Javascript and CSS via the built in WordPress enqueue capabilities. Gravity Forms does not include these by default when calling a form via a function call and they are necessary for forms that contain conditional logic or the date picker field.

    We strongly recommend you enqueue the scripts rather than including them as hard-coded calls in your theme. Implementing it this way will insure that Gravity Forms does not include them on the page if they are already present. It is also a good practice to only load these scripts on the front end.

    Gravity Forms 1.5 introduced the gravity_form_enqueue_scripts function which allows you to easily enqueue the necessary Gravity Forms' scripts and styles when manually embedding a form. This is also useful if you are using a GF widget and do not wish for the styles and scripts to be loaded inline.

    You will need to manually enqueue the scripts and CSS by placing a short script block in your theme's header.php file.

    You can find more information at the URLs below

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

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

    Posted 14 years ago on Friday May 20, 2011 | Permalink
  3. ragnarok
    Member

    Thanks for your response. Ive inserted the code you suggested. However I now get the error: "
    Fatal error: Call to undefined function gravity_form_enqueue_scripts() in /websites/123reg/LinuxPackage21/th/eh/iv/thehivelewes.co.uk/public_html/wp-content/themes/ArtSee/header.php on line 23"

    Just so you know I am currently using this code to insert my sign up form"

    <?php echo do_shortcode('[gravityform id=2 name=TEXT title=boolean description=boolean ajax=boolean]'); ?>

    How can I resolve this?

    Posted 14 years ago on Thursday May 26, 2011 | Permalink
  4. you don't ned to use the "do_shortcode" method to embed a form. There is a native Gravity Forms function to embed a form outside the loop.

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

    Posted 14 years ago on Thursday May 26, 2011 | Permalink
  5. @ragnorak What version of Gravity Forms are you using? If that enqueue function doesn't exist it sounds like you are running an old version of Gravity Forms. You may need to update to the latest version.

    Posted 14 years ago on Thursday May 26, 2011 | Permalink
  6. ragnarok
    Member

    Thanks for the info.

    I currently have version: 1.3.13.1. I see that the enqueue function doesnt exist until version 1.5. Will updating to the latest version remove any of my form fields/ data that is currently on the site?

    Thanks

    Posted 14 years ago on Thursday June 9, 2011 | Permalink
  7. Updating Gravity Forms should not impact your form data.

    BUT before you update make sure the database user your wp-config.php file is configured to run under has FULL rights to your database (including ALTER, it's best to give that user FULL permissions).

    We've had users upgrade who's database user didn't have ALTER permissions so the update was unable to create new database columns which caused problems.

    Posted 14 years ago on Thursday June 9, 2011 | Permalink
  8. ragnarok
    Member

    Thanks for your speedy response. I've updated to v1.5.2.3, and everything works perfectly fine. I will try this technique - and get back to you.

    Posted 14 years ago on Thursday June 9, 2011 | Permalink
  9. ragnarok
    Member

    Wow! Thats worked a charm, there is no longer a jump between the normal pages, and the contact page.

    I am now happy for you to close this topic.

    Thanks again for your amazing support!

    Posted 14 years ago on Thursday June 9, 2011 | Permalink

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