JessicaBBG Posted September 10, 2015 Share Posted September 10, 2015 Hi all, PHP newbie here. I've been trying to integrate Gravity Forms with Gravity View's Import Entries from CSV plugin. Unfortunately, it needs a bit of tweaking to get everything connected properly. I used a code snippet from David at Gravity Whiz, (HERE) that gets integrated into my Wordpress site's functions.php file, and have been trying to customize to to suit my needs. From what I understand in looking at the code, the only bit I need to tweak (I think) is the bottom portion: # Configuration new GW_Value_Exists_Validation( array( 'target_form_id' => 1, 'target_field_id' => 3, 'source_form_id' => '/RSVPcodes.csv', 'source_field_id' => 'rsvp', 'validation_message' => 'Hey! Don\'t be a villain! Provide a legit RSVP code to reserve your spot at the Smackdown.' ) ); My main question here: how to get the validation code to see the database that I've uploaded via the Import Entries plugin? I know ignorance is making me miss something that should be pretty simple. Right now, I've got it to validate a test word that I know is not in my database, and also a code that I know is in the database. It's coming back with both items as not valid. The end result will be a RSVP form that will be used to accept RSVPs only from people who have an RSVP code from their invitation, a lot like a license key validation system. The live site (and form I'm trying to tweak) is HERE. Thanks in advance for any help. Quote Link to comment https://forums.phpfreaks.com/topic/298122-php-form-validation-against-csv-with-wordpress/ Share on other sites More sharing options...
iarp Posted September 11, 2015 Share Posted September 11, 2015 The function you linked to via gravitywiz seems to be a function used to validate one form's field against another, not as a lookup system using CSV. If anything I would expect you to have to use a CSV import utility to put the RSVP numbers into the backend and then use the function to compare two forms. I don't know gravity forms at all, I'm just going based off what you posted above and the page you linked to. Quote Link to comment https://forums.phpfreaks.com/topic/298122-php-form-validation-against-csv-with-wordpress/#findComment-1520642 Share on other sites More sharing options...
JessicaBBG Posted September 17, 2015 Author Share Posted September 17, 2015 Thanks iarp, After a lot of tweaking, I've managed to get everything validating properly. I had the wrong settings for 'source_form_id' and 'source_field_id'. Now, the final step is to make it so each code can only be used one time. Has anyone had luck with this kind of thing? Also, I had to password protect the site to keep people from RSVPing prematurely. Pass is bbg2314 for those interested in viewing. –J Quote Link to comment https://forums.phpfreaks.com/topic/298122-php-form-validation-against-csv-with-wordpress/#findComment-1521029 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.