how can i show errors' message like it shows in fields required in CE

Hello everyone.

I override check_from function to do a validation of custom fields but, how can i show errors' message like this?

This errors' message shows when i try save a required fields empty. And i want show my messages like this under de fields where the custom error was found.

My js code to override check_form is:

function ckContactTaken()
{
    if (document.getElementById('identificador_c').value === '') {
        alert("Vacío");
        return false;   
    }
}

function check_form(formname)
{
    bValid = false;
    if(typeof(siw)!='undefined'&&siw&&typeof(siw.selectingSomething)!='undefined'&&siw.selectingSomething) return false;
    bValid = validate_form(formname,'');
 
    if(!bValid) return false;
   
    if(!ckContactTaken()) return false;
   
    return true;  
}

Thanks to this post: How can I override the check_form function in javascript? 

Someone knows how to show these messages.
Thanks to all.
Parents Reply
  • Hi Shoan

    Sorry I think my last message was not clear enough. Basically what I need is to introduce an specific validation for different fields, not only check if they are required or not. So for example check if the phone number starts by +33, or any other validations checks, and so the error message shown would have to be related to the validation and field to check.

    The code I have found in the link you showed to me (as far I understand it sorry) is valid only to check if a field is require,but how to introduce custom JQuery or JS validations and messages??

    Thanks a lot in advance once more

Children