Title: Problem with array_key_exists() warnings
Last modified: August 20, 2016

---

# Problem with array_key_exists() warnings

 *  [mattkoltermann](https://wordpress.org/support/users/mattkoltermann/)
 * (@mattkoltermann)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/problem-with-array_key_exists-warnings/)
 * I’ve created a form that contains, among other standard Gravity Form fields, 
   product, name, address, and credit card fields. When I complete the fields using
   any one of the test card details provided by Stripe and submit the form, the 
   test payment is correctly processed but there are a series of seven warnings 
   that briefly appear directly below the submit button on my form as it’s being
   processed right before being redirected to the confirmation page. Six of them
   look exactly like this:
 * `Warning: array_key_exists() [function.array-key-exists]: The first argument 
   should be either a string or an integer in /home/rutgersc/public_html/wp-content/
   plugins/gravity-forms-stripe/stripe.php on line 2356`
 * [Here’s a screenshot of the warnings.](http://ow.ly/i/1cN18)
 * I’m running WordPress 3.4.2, Gravity Forms 1.6.10, and Gravity Forms + Stripe
   1.6.9.1.
 * Any ideas? Thanks for your help debugging!
 * [http://wordpress.org/extend/plugins/gravity-forms-stripe/](http://wordpress.org/extend/plugins/gravity-forms-stripe/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Thread Starter [mattkoltermann](https://wordpress.org/support/users/mattkoltermann/)
 * (@mattkoltermann)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/problem-with-array_key_exists-warnings/#post-3243184)
 * Wow. After hours of trying to figure it out myself, of course I discover the 
   root of the problem 20 mins after posting this 🙂
 * The reason why those error messages were appearing is because I had “Page” selected
   under Form Settings > Confirmation and Ajax set to “true”. When I changed the
   setting to “false” the warnings disappeared.
 * I’ll leave this open in case this is a potential issue the developer might like
   to address, unless this is functioning as designed.
 *  [Dave](https://wordpress.org/support/users/ddemuth/)
 * (@ddemuth)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/problem-with-array_key_exists-warnings/#post-3243199)
 * Hmmm I’m experiencing this issue too.
 * The above solution does not solve it. I have text selected and ajax is false.
 * Here is whats in line 2356
 *     ```
       if ( 'creditcard' == $input_type ) {
   
       			if ( ! array_key_exists( $field['inputs'][0]['id'], $lead ) ) {
       				$input_name = "input_" . str_replace('.', '_', $field['inputs'][0]['id']);
       				$original_value_changed = $original_value = rgpost( $input_name );
       				$original_value_changed = str_replace( ' ', '', $original_value_changed );
       				$card_number_length = strlen( $original_value_changed );
       				$original_value_changed = substr( $original_value_changed, -4, 4 );
       				$original_value_changed = str_pad( $original_value_changed, $card_number_length, "X", STR_PAD_LEFT );
       				if( $original_value_changed == $value ) {
       					$value = $original_value;
       				}
       			}
   
       		}
       ```
   
 * Any suggestions?
 *  [Dave](https://wordpress.org/support/users/ddemuth/)
 * (@ddemuth)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/problem-with-array_key_exists-warnings/#post-3243200)
 * Interesting. I set form to ajax=”true” and the warnings disappear.
 *  Thread Starter [mattkoltermann](https://wordpress.org/support/users/mattkoltermann/)
 * (@mattkoltermann)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/problem-with-array_key_exists-warnings/#post-3243201)
 * Very strange, Dave…that’s the opposite of what worked for me.
 *  [arir456](https://wordpress.org/support/users/arir456/)
 * (@arir456)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/problem-with-array_key_exists-warnings/#post-3243204)
 * I seem to be having the same problem as you but have absolutely no idea how to
   fix it. I have “text” selected under Form Settings > Confirmation and I have 
   no idea how to change the “ajax”. Is there anything you to can suggest please?
 * How do I switch “ajax” ? Please help if you can.
 * Thank you!
 *  [Dave](https://wordpress.org/support/users/ddemuth/)
 * (@ddemuth)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/problem-with-array_key_exists-warnings/#post-3243205)
 * Ajax can be set to true or false in the shortcode. Go to the page where the form
   is on. When you use the add form button, the ajax setting can be checked/unchecked
   there.
 * Same applies if it’s used in a widget.
 *  [chrome88](https://wordpress.org/support/users/chrome88/)
 * (@chrome88)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/problem-with-array_key_exists-warnings/#post-3243208)
 * just for the record, using “ajax=true” worked for me. before that (using the 
   default of ajax not being defined in the shortcode) i was getting the same error
   message.
 *  [Scoobiefan](https://wordpress.org/support/users/scoobiefan/)
 * (@scoobiefan)
 * [13 years ago](https://wordpress.org/support/topic/problem-with-array_key_exists-warnings/#post-3243209)
 * I had ajax=false, and would get the warnings at the top of the page when an error
   happened or when the confirmation message was shown (they go to a confirmation
   page now)
 * I set ajax=false and it shows up for a brief second below the submit button, 
   but only if the form is a success. If the card does not go through, I do not 
   see these messages.
 * Thank you for making an error that would definitely **be** seen turn into an 
   error that **might** be seen.
 * Tried to do some editing with no success. If I figure it out I’ll make sure to
   post something.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Problem with array_key_exists() warnings’ is closed to new replies.

 * ![](https://ps.w.org/gravity-forms-stripe/assets/icon-256x256.jpg?rev=1368417)
 * [Gravity Forms + Stripe](https://wordpress.org/plugins/gravity-forms-stripe/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gravity-forms-stripe/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gravity-forms-stripe/)
 * [Active Topics](https://wordpress.org/support/plugin/gravity-forms-stripe/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gravity-forms-stripe/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gravity-forms-stripe/reviews/)

 * 8 replies
 * 5 participants
 * Last reply from: [Scoobiefan](https://wordpress.org/support/users/scoobiefan/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/problem-with-array_key_exists-warnings/#post-3243209)
 * Status: not resolved