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.

Can I use the gform_field_validation hook twice to validate two fields?

  1. petitshoo
    Member

    Hi,

    I have fields on different forms that need to have custom validation. When I use the form_field_validation code twice in the form_display.php, it makes the whole site no longer visible and I can't access the Wordpress admin panel.

    How can I do this?

    Posted 12 years ago on Saturday April 21, 2012 | Permalink
  2. petitshoo
    Member

    Is there anybody at all out there?? Here's the code I'm using:

    http://pastie.org/3831652.js

    The promotion starts tomorrow and I need to get this resolved. When I use this code twice (changing the database parameters and the field id and form id) it completely takes down my whole site. Please can someone tell me if there is a way to do two custom field validations?

    Thanks!

    Posted 12 years ago on Sunday April 22, 2012 | Permalink
  3. Looks like pastie.org is down - can you paste/supply your code here or try http://pastebin.com/ perhaps?

    Posted 12 years ago on Tuesday April 24, 2012 | Permalink
  4. petitshoo
    Member

    Here's the code again:

    http://pastebin.com/97GfDfTH

    I used it at the bottom of my form_display.php

    Thanks!

    Posted 12 years ago on Friday April 27, 2012 | Permalink
  5. David Peralty

    It doesn't belong in form_display.php. It should be in your theme's functions.php file (if this file doesn't exist, you'll need to create it)

    http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F

    Posted 12 years ago on Friday April 27, 2012 | Permalink
  6. petitshoo
    Member

    And should I be able to use it twice in functions.php?

    Posted 12 years ago on Friday April 27, 2012 | Permalink
  7. David Peralty

    Should be able to. I'm not exactly sure though as I've never personally done it.

    Posted 12 years ago on Friday April 27, 2012 | Permalink
  8. petitshoo
    Member

    The code doesn't work in functions.php like it did in form_display.php. No validation is happening. Is there a particular place within functions.php I should be pasting it? I pasted it at the bottom within in the <?php (I put code here) }?> that was at the very bottom of the page.

    Posted 12 years ago on Friday April 27, 2012 | Permalink