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.

set field focus on load?

  1. I am creating a landing page. The temporary URL (just for experimentation) is at
    http://www.highlifegourmet.com

    It is a one-field form. I want to make the border of the field transparent / invisible...whatever. And I want the focus to be set in the field on page load.

    Is this possible? I searched these forums but could not find a "set focus" topic.

    I tried putting this in my "body":

    <body OnLoad="document.gform_1.gform_fields_1.focus();">

    but it did not work... Any idea why?

    Thank you in advance!

    Posted 13 years ago on Monday February 14, 2011 | Permalink
  2. looks like the script you're using is targeting the form via the name attribute. You form doesn't have a name attribute so it doesn't know what to do.

    <form method='post' enctype='multipart/form-data' id='gform_1' class='gform_wrapper_1' action='http://highlifegourmet.com/'>

    Look for a script where you can use the form ID instead of the name attribute you could always use jQuery to dynamically set a name attribute on the form when the page loads.

    Posted 13 years ago on Monday February 14, 2011 | Permalink
  3. To make the border of the field transparent/invisible you would write some custom CSS and add it to your themes stylesheet. You can target Gravity Forms HTML elements using CSS just like you can anything else in your theme and you use CSS to overwrite the default form styles.

    As for the focus issue, i'm not familiar with that code to know if that will work or not. That is a customization so you would have to implement it on your end, targeting the form field element using jQuery should work just like targeting any form field element as Gravity Forms is standard HTML, CSS and jQuery.

    Posted 13 years ago on Monday February 14, 2011 | Permalink
  4. Thanks for pointing me in the right direction guys.

    Posted 13 years ago on Monday February 14, 2011 | Permalink