Search the Community
Showing results for tags 'gravity forms'.
-
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.
- 2 replies
-
- form validation
- csv
-
(and 2 more)
Tagged with:
-
how can i display numbers with shortcode of submitted from gravity form only from current logged in user add_filter( 'gform_shortcode_entry_count', 'gwiz_entry_count_shortcode', 10, 2 ); function gwiz_entry_count_shortcode( $output, $atts ) { extract( shortcode_atts( array( 'id' => false, 'status' => 'total', // accepts 'total', 'unread', 'starred', 'trash', 'spam' 'format' => false // should be 'comma', 'decimal' ), $atts ) ); $valid_statuses = array( 'total', 'unread', 'starred', 'trash', 'spam' ); if( ! $id || ! in_array( $status, $valid_statuses ) ) { return current_user_can( 'update_core' ) ? __( 'Invalid "id" (the form ID) or "status" (i.e. "total", "trash", etc.) parameter passed.' ) : ''; } $counts = GFFormsModel::get_form_counts( $id ); $output = rgar( $counts, $status ); if( $format ) { $format = $format == 'decimal' ? '.' : ','; $output = number_format( $output, 0, false, $format ); } return $output; }