Tell us what you are trying to do?
I have a Post form with field titled job-url, how can i prepend a value to the field when submitted.
The user must enter the url for the job into the field.
We have a form that we pass the url through to capture information.
Example,
User enters joburl = "hidden link "
What I need to add to that before it gets int eh database is
"hidden link "
So what gets inserted into the db is
"hidden link "
Is there any documentation that you are following?
I searched but could not find anything to reference this.
Is there a similar example that we can see?
What is the link to your site?
This is the dev site. hidden link
The password is "toolsetrocks"
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
You can use the Toolset form hook "cred_before_save_data" to adjust the value of any of your form field before it gets saved to database.
Add the following hook to "Custom Code" section offered by Toolset:
=> https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/
add_action('cred_before_save_data', 'func_adjust_job_url_field',10,1);
function func_adjust_job_url_field($form_data){
// if a specific form
if ($form_data['id']==111182) {
if (isset($_POST['wpcf-job-url']) and !empty($_POST['wpcf-job-url'])){
$job_url_link = "<em><u>hidden link</u></em>".$_POST['wpcf-job-url'];
$_POST['wpcf-job-url'] = $job_url_link;
}
}
}
More info:
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_before_save_data