I am using the following hook for extracting the value of a field and i want to save the data for this field in the database.
I am using the following hook for extracting the value of a field and i want to save the data for this field in the database.
Here is an example of the gform_pre_submission hook which shows changing a form field value, which then gets stored as that field value in the entry data.
<?php
add_action("gform_pre_submission", "pre_submission_handler");
function pre_submission_handler($form){
$_POST["input_14"] = "new value for field 14";
}
?>
This example would apply this change to ALL forms. Probably not what you want to do. You want to specify a specific form id by appending it to gform_pre_submission like so:
<?php
add_action("gform_pre_submission_5", "pre_submission_handler");
function pre_submission_handler($form){
$_POST["input_14"] = "new value for field 14";
}
?>
Notice the _5 in the gform_pre_submission action call above. This it the form id the code will be applied to.
The example above shows how to change an input value. Doing the above would change it's value and it would then be stored in the entry table.
Thank you so much Carl Hancock now every things is fine.