Hi, Melanie_D,
Take a look at the "gform_field_input" and "gform_field_content" hooks.
http://www.gravityhelp.com/documentation/page/Gform_field_input
http://www.gravityhelp.com/documentation/page/Gform_field_content
With those hooks you are able to take a field on your form and completely change it. So you could have a hidden field on your form and then recreate the field's <input> tag.
Below is an example where I took my hidden tracker field (field 11) on my form (form id 23) and rebuilt the tag:
add_action("gform_field_input", "tracker", 10, 5);
function tracker($input, $field, $value, $lead_id, $form_id)
{
if ($form_id == 23 && $field["id"] == 11)
{
$input = '<input type="hidden" id="hidTracker" name="hidTracker" value="test">';
return $input;
}
}
When that runs, the HTML has my new version of the tag.
Posted 12 years ago on Friday February 3, 2012 |
Permalink