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.

auto generate digit and check if its correct?

  1. Hi there,

    I need the same solution as asked on topic:

    http://www.gravityhelp.com/forums/topic/validation#post-40648;

    Chris says that he hase done this:
    "I have done this, check an entered value against a database value to see if it's valid. After you make your purchase I will be happy to help you implement it. There are several code examples here that explain how it was done."

    Is there a tutorial of this??

    Thnx

    Posted 11 years ago on Tuesday August 14, 2012 | Permalink
  2. @Totalprofile, what do you need to do exactly?

    Here is some code which takes a value input by a visitor, checks against a list of numbers (which was stored in a text file on the server) and returns a validation error if there is no match: http://pastebin.com/7ANQh6Rc

    Here is the discussion of that solution:
    http://www.gravityhelp.com/forums/topic/forcing-a-field-to-only-accept-registered-usernames-of-a-spesific-role-as-input

    Here is a page where the form is in use: http://gravity.chrishajer.com/verify-your-code/

    You can use 117237739 or 116482217 as valid numbers (these numbers exist in the file.)

    I think I did something funny with the confirmation, so you can ignore that. An invalid code will show a validation error. Success will just direct the visitor to the home page of the site, with the code appended to the query string (check the address bar.) That was for some other demo I believe.

    Posted 11 years ago on Tuesday August 14, 2012 | Permalink
  3. hi there,

    I need to publish an automatic populate numeric field and then this numeric must be filled (and controled -> is it the correct numeric) in before the form can be send..

    Posted 11 years ago on Tuesday August 14, 2012 | Permalink
  4. I'm not sure I understand. Can you please provide more details, and include a link to any examples you may have online. Thank you.

    Posted 11 years ago on Wednesday August 15, 2012 | Permalink
  5. Sorry i don't have a online example :S

    I wil try to explain it better.

    On some point in a form the user must file in a radio checkbox with the options YES or NO.
    If the user chooses YES then a new textfield must appear with a prefilled digit-code.

    The digit-code that's displayed the user must fill in a numeric field (and then it must be crossreverenge to check if the code is the correct one).

    When the check is correct, then the customer can send the form.

    Posted 11 years ago on Wednesday August 15, 2012 | Permalink
  6. OK, I get the Yes/No radio button.

    I see that a text field has to appear after ticking "Yes". Where does the number come from which should be prefilled there?

    And what determines if there is a match? Are the numbers the same? That does not seem to make sense to me, as they would just type in what they see on screen. So, are there pairs of numbers stored somewhere, and the pairs need to be matched before they can continue?

    Do you have an example of the data that will be used? Maybe we can determine how it needs to work if we can see a sample of the data. Thank you.

    Posted 11 years ago on Wednesday August 15, 2012 | Permalink