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.

Validation not working on custom form

  1. I have a custom form which i created by copying the gravity form code and removing the divs and only using the form code. I have inserted the code in my wordpress widget.

    you can view the form from here:
    http://50.116.122.182/~outsidea/

    its the form on the right under get started today.

    The form works when i enter all the fields and submit. but the validation do not work.
    if i left the fields blank and click submit the home page loads again with out showing any error on the same or next page.

    Here is the code that i am using inside my widget:

    <link media="all" type="text/css" href="http://50.116.122.182/~outsidea/wp-content/plugins/gravityforms/css/forms.css?ver=3.3.1" id="gforms_css-css" rel="stylesheet">
    <form action="/~outsidea/" id="gform_2" enctype="multipart/form-data" method="post">

    <input type="hidden" value="Submitted" name="formState">
    <table width="220" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td align="center"><input name="input_1.3" id="input_2_1_3" tabindex="1" type="text" value="  first name" onfocus="if (this.value == '  first name') this.value = '';" />
    </td>
    </tr>
    <tr>
    <td align="center"><input id="input_2_1_6" name="input_1.6" tabindex="2" type="text" value="  last name" onfocus="if (this.value == '  last name') this.value = '';" />

    </td>
    </tr>
    <tr>
    <td align="center"><input id="input_2_2" name="input_2" tabindex="3" type="text" value="  email address" onfocus="if (this.value == '  email address') this.value = '';" />

    </td>
    </tr>
    <tr>
    <td align="center"><input id="input_2_3" name="input_3" tabindex="4" type="text" value="  phone (555-555-1234)" onfocus="if (this.value == '  phone (555-555-1234)') this.value = '';" />

    </td>
    </tr>
    <tr>
    <td align="center"><input type="submit" tabindex="5" value="Submit Query" id="submitButtonLink" />

    <input type="hidden" value="1" name="is_submit_2" class="gform_hidden">
    <input type="hidden" value="2" name="gform_submit" class="gform_hidden">
    <input type="hidden" value="50cf389b27a99" name="gform_unique_id" class="gform_hidden">
    <input type="hidden" value="YToyOntpOjA7czo2OiJhOjA6e30iO2k6MTtzOjMyOiIwMzM3YmNjZjBkMjhjZmQ0NGRjNmMyODQyYWMzNDcwMiI7fQ==" name="state_2" class="gform_hidden">
    <input type="hidden" value="0" id="gform_target_page_number_2" name="gform_target_page_number_2" class="gform_hidden">
    <input type="hidden" value="1" id="gform_source_page_number_2" name="gform_source_page_number_2" class="gform_hidden">
    <input type="hidden" value="" name="gform_field_values">

    </td>
    </tr>
    </table>
    <table width="220" border="0" cellspacing="0" cellpadding="0">
    <tr> </tr>
    </table>
    </form>
    <script type="text/javascript"> jQuery(document).ready(function(){jQuery(document).trigger('gform_post_render', [2, 1])}); </script>

    Posted 11 years ago on Saturday December 29, 2012 | Permalink
  2. Gravity Forms was not designed to be used like that. Is there a reason you cannot use the Gravity Forms widget to insert the form properly?

    When using a form like this, which is not supported, you would probably have to include the Gravity Forms scripts and styles manually to ensure the form works (looks like you already did that with the stylesheet). I'm not sure if that would work, but if you insert the form like this, chances are the scripts are not present which is why the validation would not work.

    Posted 11 years ago on Saturday December 29, 2012 | Permalink
  3. How can i change the form that gravity form produces like the look i want.
    Gravity form makes a simple looking form. Is there a way of changing it to look like the one i have on my website?

    Posted 11 years ago on Sunday December 30, 2012 | Permalink
  4. You can style a Gravity Form like you can style any other element in your WordPress installation. You use CSS and add that to your theme's stylesheet. If you would like to start over, please start a new topic. Embed the form normally in a page or post, using the shortcode, so that validation works, and then post the link to that page or post, and let us know what elements you want to change.

    If you want, you can alternatively turn off the output of the Gravity Forms CSS (on the Forms > Settings page, select "No" for the radio button option "Output CSS". That will suppress the output of the Gravity Forms stylesheet, and rely strictly on the styles which are included in your theme. Most themes do not include styles for every form element, so you may still need to do additional work. You can try with or without the Gravity Forms CSS and determine which method is closer to your desired outcome, then ask for help from there.

    Posted 11 years ago on Sunday December 30, 2012 | Permalink

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