Mandatory field in form… not mandatory
-
Hi,
I’ve added a field in my registration form, called “URL de votre book EtoileCasting” as in https://actu.etoilecasting.com/evenements-a-venir/chant-casting-avec-renaud-hantson
I’d like it to be mandatory, so I’ve added this to my functions.php file :
function em_validate($result, $EM_Event){
if (!is_user_logged_in() && $_REQUEST[‘booking_comment’] == ”){
$EM_Event->add_error(‘Merci de remplir votre nom, mail, téléphone et URL de votre book en ligne EtoileCasting.’);
$result = false;
}
return $result;
}
add_filter(’em_event_validate’,’em_validate’, 1, 2);But the field still isn’t mandatory.
The strange thing is that I’ve done the same for the user field (changing the name of the field in the request for user_name) and it works fine.Please note that I use the “non-logged in” mode of the plugin.
Thanks in advance for your help.
Deborah
- The topic ‘Mandatory field in form… not mandatory’ is closed to new replies.