I have a form and two of the fields are "Account Number" and Re-enter Account Number". I need to make the form require those two fields to match before a user can submit. How do I do this with GF?
I have a form and two of the fields are "Account Number" and Re-enter Account Number". I need to make the form require those two fields to match before a user can submit. How do I do this with GF?
Hi AB. I have done this before. Please see here:
http://gravity.chrishajer.com/check-your-ticket-number/
I think that does exactly what you want. Here is the code to make that happen: http://pastebin.com/FqsWDDa4
Please let us know if you have any questions.
Thanks, I used your code and changed the input_ids to match mine, but it's trying to match input_1 and input_2 instead of input_2 and input_3 (which I changed it to do).
Sounds like something is not configured correctly. Can you post all the code you are using at pastebin.com or pastie.org and I will take a look at it? It did work before.
Here is my pastebin:
http://pastebin.com/LuEWpD7n
Take a look at the inline comments on lines 11 and 14. You need to use $form['fields'][1] and $form['fields'][2]. It's a zero based array, so fields 0 and fields 1 are input_1 and input_2. Change lines 12, 13, 15 and 16 and you will be good to go.
Thank you, that worked. I had to change those numbers to the order in which those inputs display on my form.
Right. Glad you got that worked out.