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.

Need some How-To advice on validation for a custom field that needs to be unique

  1. rmbraaten
    Member

    I would like a form that allows visitors to check the availability of a desired email ID (single custom field) before they place an order. So, for example, visitor #1 types in "johnsmith" into the EMAILID field. The form accepts the submission as valid since no other visitor has reserved "johnsmith." Then, if visitor #2 comes along and enters "johnsmith" into the EMAILID field, he will get a message stating that "the EMAILID 'johnsmith' name is already reserved, try another."

    This is similar in function to checking the whois for domain names, except that all the names are stored in "EMAILID" field of form submission table not any external server, which continues to grow as users submit unique EMAILIDs.

    Can someone give me a lead on how I can set this up with GravityForms?

    Thanks!

    Posted 7 years ago on Monday October 8, 2012 | Permalink
  2. Each field has a checkbox "No Duplicates" which will check the database to see if the value exists in the form entries already, and if so, return a validation error. Does that work for you?

    Posted 7 years ago on Monday October 8, 2012 | Permalink
  3. rmbraaten
    Member

    That was quick! To answer your question, that depends. Ideally, I want the user to know that a name is available before they purchase. I suppose the gform_validation would be ok so long as I could accept payment AFTER the user finds a unique name and not before (that would be messy). Ideally, a front end solution with instant feedback (like gmail or instantdomainsearch.com) would be best, but I'm open to the gform_validation to get me started--especially if it's easier and cheaper.

    Posted 7 years ago on Monday October 8, 2012 | Permalink
  4. You can accept payment after the form goes through successfully. Payment would not be processed before you told the visitor if their name was available or not. This is the cheapest and easiest way to do it with no additional code.

    To do it on the front end, it would be a bunch of additional code and jQuery. gform_validation would be unnecessary and would only apply on the back end. It would work identical to "no duplicates." Maybe you can try it with the "No Duplicates" option first?

    Posted 7 years ago on Monday October 8, 2012 | Permalink
  5. rmbraaten
    Member

    Great, thank you! The no duplicates option will work best.

    Posted 7 years ago on Tuesday October 9, 2012 | Permalink

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