Answers for "laravel change'please fill out this field' to arabic"

4

laravel change'please fill out this field' to arabic

//Change default validity message 'please fill out this field' to your language
//Add following code in JavaScript
$("form :input").each(function(){
    var input = $(this);
    var msg   = 'Message in your language';
    input.on('change invalid input', function(){
        input[0].setCustomValidity('');
        if(!(input[0].validity.tooLong || input[0].validity.tooShort)){
            if (! input[0].validity.valid) {
                input[0].setCustomValidity(msg);
            }
        }
    });
});
Posted by: Guest on June-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language