[Resuelto] required error appears in cred frontend dispite fulfilled requirement
This support ticket is created hace 6 años, 5 meses. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
when editing the play, try to add some text to the "play description", then scroll to the bottom and press save.
the error that popsup is that you need to check at leaset 1 genre - but there are already a few genres checked.
Sorry, I can't debug your custom JavaScript for you.
We have an API for form validation, and you can make taxonomies required by adding code such as the following to your theme's functions.php file:
function tssupp_require_genre($field_data, $form_data) {
// Split $field_data into separate $fields and $errors
list( $fields,$errors ) = $field_data;
// validate specific form
if ( $form_data['id'] == 123 ) {
// check if genre taxonomy set
if ( empty( $fields['genre']['value'] ) ) {
$errors['genre'] = 'You must select a genre';
}
}
return array($fields,$errors);
}
add_filter( 'cred_form_validate', 'tssupp_require_genre', 10, 2 );
Edit the form ID and the taxonomy slug as required.
If you can't get your JS solution to work I suggest you go with our API method.