Forum Replies Created
-
AuthorPosts
-
Daniels
ParticipantThe support here isn’t very helpful.
I couldn’t wait for them to add this option so i used a gravity forms hook to loop through all answers checking if its autocomplete field and if it is then save it somewhere where i need it.
If you know something about coding here is my answer:
/*Save new companies after successful form submission*/ add_action( 'gform_after_submission', 'action_gform_after_submission', 10, 2 ); function action_gform_after_submission( $entry, $form ) { $companies = getSurveyCompanies(); $new_companies = array(); foreach ( $form['fields'] as $field ) { if($field->get_input_type() == 'autocomplete'){ $value = htmlspecialchars(rgar( $entry, (string) $field->id )); if($value){ $is_in_db = false; if(strlen($value) > 170){ $value = substr($value,0, 170); } foreach ($companies as $company){ if($company->name == $value){ $is_in_db = true; break; } } if(!$is_in_db){ array_push($new_companies, $value); } } } } if(!empty($new_companies)){ foreach ($new_companies as $company){ if(strlen($company) > 3){ addSurveyCompany($company); } } } } /*END Save new companies after successful form submission*/Daniels
ParticipantThey gave me version 1.8.7, but the bug persists in that version as well. Can you tell me in what version this bug should be fixed?
-
AuthorPosts