I need to validate a field against another field, much like what has been done with the email fields. I need to make sure that the contents of field1 match the contents of field2. Is there any way to do this within gForms?
I need to validate a field against another field, much like what has been done with the email fields. I need to make sure that the contents of field1 match the contents of field2. Is there any way to do this within gForms?
Yes. You'd have to write custom validation using the gform_validation hook. This hook is documented here:
http://www.gravityhelp.com/documentation/page/Gform_validation
Ok, that's reasonably do-able. Now the question, what's the best way to approach this on a multi-site setup with gForms active on almost every site?
Are the sites already active and you just want to replicate the new form across all existing sites? Or, do you want this new form to be present in all new sites created from this point forward?
I think neither. I need to be able to do this on one form on one site in a multi-site installation. Specifically, I have a user information form on my Admissions website where I need to validate 2 fields against each other.
I think my question is more "how do I implement this on a multi-site install where I'm using the same theme throughout the site and form id's may replicate between individual blogs". From what I can see, it lets you identify form fields and specific form id's, but when form1 on one site needs different validation from form1 on another site, using the same functions.php file, I smell a conundrum.
I'm using Genesis and a single theme.
So in your multi-site installation, multiple sites use the same functions.php and same theme files? Can you post the URLs for two of the sites so I can see the differences? I'm sure there is some condition we can test for to make the code run on only one of the sites. I'm certain of it, but we need to find out what that unique thing will be.
Do I understand the conundrum: you're planning on having Gravity Forms active on all (or many) sites in a multi-site installation, so the potential exists that a new site creating its first form, form 1, would conflict with this special form 1 you created, which has this custom validation. Is that correct?
Hi
As Shelley mentions in her original post, "much like what has been done with the email fields" - is there example code somewhere for this function? I need a double input of the email address, and for them to check against each other?
Thanks
Just realised this is already built in by default as 'enable email confirmation' when adding an email field...