Email validation not working

Home Forums Quform PHP Email validation not working

This topic is: not resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #18765
    Onuphriy
    Participant

    Hello!

    I have multilingual site and I changed this piece of code in process.php:

    $email->addValidators(array('required', 'email'));

    with this:

    switch ($lang) {
    case "ru" : $required_fields_lang = "Обязательно к заполнению"; break;
    case "en" : $required_fields_lang = "This field is required"; break;
    case "es" : $required_fields_lang = "Campo requerido"; break;
    case "fi" : $required_fields_lang = "Pakolliset kentät"; break;
    case "fr" : $required_fields_lang = "Champs obligatoires"; break;
    case "de" : $required_fields_lang = "Pflichtfelder"; break;
    case "no" : $required_fields_lang = "Obligatoriske felt"; break;
    case "pl" : $required_fields_lang = "Pola wymagane"; break;
    case "sv" : $required_fields_lang = "Obligatoriska fält";
    }
    ...
    $email->addValidator('required', array(
    'messages' => array('required' => $required_fields_lang)
    ));

    Now when I leave email field empty I just get message in $required_fields_lang but there is no validation for email field (<some_text>@<domain_name>.<domain_zone>).

    How should I change $email->addValidator() to get email validation works. Thank You!

    P.s. Sorry for my weak English.

    #18775
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy