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 via external Databasetable

  1. Hi there,

    is it possible to create a field e.g. "CustomerNumber" which is checking an external databasetable and outputs the customername from this one?

    External DB:
    CUSTOMERNUMBER | CUSTOMERNAME

    Gravity Form:
    Field "Customernumber" -> AJAX read external DB and outputs the matching Customername

    Thank you

    Posted 13 years ago on Monday July 11, 2011 | Permalink
  2. This could only be done as a customization. You'd could use jQuery and AJAX so when the customer enters information in that field it executes jQuery, which then may execute some AJAX code.

    Another option would be to use a multi-page form and then use custom PHP to use the gform_validation hook. Have the customer number on the first page of the form, the gform_validation hook could then fire and validate the customer number and then pre-populate the appropriate fields.

    There is How To examples for both the gform_validation hook and dynamically populating fields in the How To section of the Documentation.

    Posted 13 years ago on Monday July 11, 2011 | Permalink
  3. Hi Carl, thanks for your answer. Multiform seems to be easier, so i changed to multiform:
    Examplepage: http://skintern.de/kunden/1-2/ (Customer = Kunden)

    In functions.php i try something like that:
    http://pastie.org/2212213

    But i have no idea, how to post the result to kundenname (input name='input_36' id='input_2_36')

    Posted 13 years ago on Thursday July 14, 2011 | Permalink
  4. We can't write the customization for you but we can point you in the right direction.

    There is a tutorial for the gform_validation hook here:

    http://www.gravityhelp.com/documentation/page/Using_the_Gravity_Forms_%22gform_valiation%22_Hook

    You would use this hook to validate the customer number and if the customer number is valida you'd then use additional PHP to dynamically populate the fields. A tutorial on how to dynamically populate fields can be found here:

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

    If you need a developer to assist you with this customization there is a list of developers with Gravity Forms experience here:

    http://wpcandy.com/pros/experienced/with-gravity-forms

    Posted 13 years ago on Thursday July 14, 2011 | Permalink