Hello, I am trying to make all fields on the form required, so I added required="true" however it is not working on all fields. It only works on Name, Email, Message however not on Booked Extension (name) or Tours name.
I also tried adding a custom code (see below) but it still doesn't work.
add_filter('cred_form_validate','form_field_validation', 2, 10);
function form_field_validation( $field_data, $form_data ) {
// field data are field values and errors
list($fields,$errors)=$field_data;
// validate if specific CRED form ID
if ( $form_data['id'] == 308 ) {
// set error message per field
if ( $fields['booked-extensions']['value'] == '' )
$errors['text-field'] = 'This field is required.';
}
return array( $fields, $errors );
}
Please let me know how to fix this issue. Thank you.
Hello,
How do you setup the custom fields "Booked Extension (name)" and "Tours name"? with Toolset Types plugin?
please take a screenshot for them, I need to test it in my localhost, thanks
It's using Post Forms. Here is the screenshot on booked extension/
I assume we are talking about some custom fields created with Toolset Types plugin.
Please try these:
Dashboard-> Toolset-> Custom Fields Group, find and edit those two custom fields: "Booked Extension (name)" and "Tours name"
Take a screenshot for them, I need to duplicate the same problem, and debug in my localhost, thanks
Hello, thank you so much for your assistance. I now figured it out after checking Dashboard-> Toolset-> Custom Fields Group.
Can you take a screenshot for those custom fields settings?
If you still need more assistance for it, please provide your website credentials in below private message box, I need to test your custom codes and debug them in a live website.
Private message box enabled, please point out the problem page URL and form URL, where I can edit you custom PHP codes.