Click here to Skip to main content
15,504,146 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
register:93 Uncaught TypeError: Cannot read property 'checkValidity' of undefined
    at HTMLInputElement.validat

this is the error i get when i try to check if the validation is working on the client page. Below is the script

script>
    $(document).on("submit", ".needs-validation", validate);
    $(".needs-validation input").blur(validate);

    function validate(event)
    {
        if ($(".need-validation")[0].checkValidity() == false || $(".email-exists").text() != "")
        {
            {
                event.preventDefault();
            }
            $(".needs-validation")[0].classList.add("was-validated");
        }
    }
</script>


and also i have the bootstrap 4.1.1 running with jquery3.3.1 and also the popper.js 1.14.3

ironically i can a similar app with the same installation and it working on it.

Taiwo Kaffo

What I have tried:

1. I have uninstalled and reinstalled all the apps
2. I have remove some new apps that was not in the old one
3. I have checked the bundle file and the settings are the same the two apps
Posted
Updated 1-Apr-20 23:25pm

1 solution

A simple spelling mistake:
HTML
$(".needs-validation input").blur(validate);

function validate(event)
{
    if ($(".need-validation")[0].checkValidity() == false || $(".email-exists").text() != "")
    {
 
Share this answer
 
Comments
taiwokaffo 2-Apr-20 4:55am    
thanks i really appreciate you..................not really looking at that.
Richard MacCutchan 2-Apr-20 5:12am    
Try doing the basic checks before you post a question. It can save you a lot of time.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900