I created a custom validation method for a field with the gform_validation filter.
Is it possible to store some data in a hidden field inside the gform_validation filter?
add_filter('gform_validation', 'media_custom_validation');
function media_custom_validation($validation_result) {
global $form_email, $file_id;
// new gravity form
$rg = new RGFormsModel();
// grab the form
$form = $validation_result["form"];
// only validate the vault form
if ($form['title'] == "Item Support") {
foreach($form['fields'] as &$field) {
// store email field in variable
if ($field['id'] == "5") {
if(true){
//success, store data in one of the hidden fields
} else {
//error
}
}
}
}
}
return $validation_result;
}