Hello,
I have added validation to my frontend form:
add_filter( 'rwmb_frontend_validate', function( $validate, $config ) {
if ('academic-research-summary' !== $config['id']) {
return $validate;
}
if ( empty( $_POST['post_title'] ) ) {
$validate = 'Title for your post is missing';
}
if ( empty( $_POST['academicpost_excerpt'] ) ) {
$validate = 'Focus is missing';
}
ect...
return $validate;
}, 10, 2 );
The messages respond to the missing fields and return. But the form loses all the information that was inputted. So when submit is clicked, you see the message but all the fields are now blank.