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.

Validating field data with predefined data set

  1. pinman
    Member

    We want following to be accompalished and hope Gravity forms can help us achieve this:

    We want to have a main form with just a field to input a product serial number. When user fills the number and submits/next, the entered number should be compared with a predefined list and if the entered number macthes to the ones defined in the list, it should show another form with multiple fields. Otherwise, the form should display a message stating that the entered serial number is not valid.
    Now, can we define such a list of alphanumeric numbers and let gravity form check it and then based on it either display the other form or display error message.
    A quick reply will be highly appreciated.

    Posted 12 years ago on Wednesday November 16, 2011 | Permalink
  2. pinman
    Member

    Still waiting for your inputs.....

    Posted 12 years ago on Wednesday November 16, 2011 | Permalink
  3. Yes, you can do this. But only as a customization. You would use the gform_validation hook and write custom code to perform your custom validation. There is a tutorial on how to use the gform_validation hook available here:

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

    This custom code would go either in your theme's functions.php file or in a custom plugin you create and activate.

    Posted 12 years ago on Wednesday November 16, 2011 | Permalink
  4. I've done this in the past with two forms. The first form checks to see if the serial number is valid, by comparing to values in the database. If not, validation fails. If it's a good serial number, continue to form two, and maybe save the serial number in a hidden field. It's definitely possible.

    Posted 12 years ago on Thursday November 17, 2011 | Permalink
  5. pinman
    Member

    Thanks Carl & Chris. I will try the steps in the tutorial link you sent.

    Posted 12 years ago on Thursday November 17, 2011 | Permalink
  6. pinman
    Member

    Carl,
    It seems i am not able to follow the tutorial you sent properly as the form is not validating the input. May be i am demanding too much, but can you help me with the exact code and steps that i can use to achieve the following:
    A basic form will make user input a 10 digit alphanumeric number. This number should be validated against the set of numbers that we will define and if it is one of those predefined numbers, user will see the next form or else will get a message that The entered number doesn`t qualify for a replacement.
    I am not a programmer so may be thats the issue :( But, i hope you can help.

    Posted 12 years ago on Thursday November 17, 2011 | Permalink
  7. Some of the more advanced customizations do take some programming. If you're not comfortable with that, you can always find a professional to help you with it. You can post your job here, or contact one of the individuals listed here, to get help. What you want to do will not likely take a long time for someone who is familiar with Gravity Forms and PHP.

    We can't write the code for you, but we can help point you in the right direction.

    Posted 12 years ago on Thursday November 17, 2011 | Permalink
  8. Hello Pinman.
    Did you get this accomplished? If so did you do it or hire someone, and if you hired someone can I get there contact info? I have the exact same task. I want to have customers enter a serial number and if it is correct they can submit the form to register the product.

    Posted 11 years ago on Friday November 9, 2012 | Permalink