PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Using gform_post_submission to retrieve Checkbox values

  1. eschoolnews
    Member

    I need to send the values of a form that has been submitted to another function on my site in the form of an array. The array is not being populated with the values from checkboxes, but other kinds of inputs are correctly input into the array. The values are being stored correctly in the form entries.

    Below are the key parts of the function.

    add_action("gform_post_submission_50", "SF_Account_Upsert50", 10, 2);
    function SF_Account_Upsert50($entry, $form){
    	global $wpdb;
    	$newperson = array();
    	if (!empty ($entry[30])) {
    			$newperson['WP_Login__c'] = strtolower($entry[30]); //this is stored correctly
    		}
    	if (!empty ($entry[32])){ //is a checkbox ... fails
    		$newperson['Grade_Level__c'] = $entry[32];
    	}
    //outside the check
    	$newperson['Grade_Level__c'] = $entry[32]; // inserts empty value
    }
    Posted 7 years ago on Tuesday April 17, 2012 | Permalink