CRED is a WordPress plugin that lets you easily build front-end forms for creating and editing content and users.
CRED User Guides include detailed documentation on creating forms, including related fields that belong to the content or the users, validating the input and displaying the forms with custom HTML styling.
When you ask for help or report issues, make sure to tell us the versions of the Toolset plugins that you have installed and activated.
Viewing 15 topics - 721 through 735 (of 980 total)
Problem:
The user changes an email input from type=text to type=email to leverage browser validation. But, then the field does not handle the backspace key to delete a string.
Solution:
No.
"cred_save_data" hook belongs to Toolset forms and it will only triggered when you submit the form that is created using Toolset.
If you are using another plugins using which you created user form, you should check with that plugin support if they offer any hook that you should use to hook your custom code.
Problem: I am trying to validate a custom field with cred_form_validate, but I cannot validate a specific field. Errors never appear in the form.
Solution: Be sure to include the form_messages field in the Form builder so errors can be displayed. Then use the following syntax to validate a custom field:
function fn_cred_form_validate($error_fields, $form_data)
{
list($fields,$errors)=$error_fields;
if ($form_data['id']==221) {
if (empty($fields['wpcf-application-tour-number']['value'])) {
//set error message for my_field
$errors['application-tour-number']='Please select tour first';
}
}
return array($fields,$errors);
}
add_filter('cred_form_validate','fn_cred_form_validate',10,2);
Notice that the wpcf- prefix is required in the $fields array, but should not be included in the $errors array.