0

I have the following code:

<div class="signup_form">
  <form action="#" method="post" id="registratie">
    <div class="row-fluid ">
      <div class="span12">
        <label for="volledige_naam">VOLLEDIGE NAAM</label>
        <input type="text" name="volledige_naam" tabindex="1" />
      </div>
    </div>
    <div class="row-fluid">
      <div class="span6">
        <label for="gebruikersnaam">GEBRUIKERSNAAM</label>
        <input type="text" name="gebruikersnaam" tabindex="2" />
      </div>
      <div class="span6">
        <label for="email">E-MAIL</label>
        <input type="text" name="email" tabindex="3" />
      </div>
    </div>
    <div class="row-fluid">
      <div class="span6">
        <label for="wachtwoord1">WACHTWOORD</label>
        <input type="password" name="wachtwoord1" tabindex="3" />
      </div>
      <div class="span6">
        <label for="wachtwoord2">HERHAAL WACHTWOORD</label>
        <input type="password" name="wachtwoord2" tabindex="4" />
      </div>
    </div>

    </div>
    <div class="row-fluid bottompad">
      <div class="span2 ">&nbsp;</div>
      <div class="span8">
        <br>
        <br>
        <button type="submit" value="Verzenden" name="submit" class="toppad button" style="vertical-align:middle"><span>VERZENDEN&nbsp;</span></button>
      </div>
      <div class="span2">&nbsp;</div>
    </div>
  </form>

And the javascript is:

<script src="https://code.jquery.com/jquery-3.2.0.min.js" integrity="sha256-JAW99MJVpJBGcbzEuXk4Az05s/XyDdBomFqNlM3ic+I=" crossorigin="anonymous"></script>

<script type="text/javascript">

<!-- https://stackoverflow.com/questions/19823998/jquery-validation-error-validate-is-not-a-function -->    

$(document).ready(function () {
    $("#registratie").validate({
        rules: {
            volledige_naam: {
                required: true,
                rangelenght: [4, 20]
                // remote:"look.php"
            },
            gebruikersnaam: {
                required: true,
                rangelenght: [4, 20]
            },
            email: {
                required: true,
                email: true
            },
            wachtwoord1: {
                required: true,
                rangelenght: [4.20]
            },
            wachtwoord2: {
                required: true,
                equalTo: "#wachtwoord1"
            }
        },
        messages: {
            gebruikersnaam: {
                required: "Please enter a username",
                minlength: "Your username must consist of at least 3 characters"
            },
            wachtwoord1: {
                required: "Please provide a password",
                minlength: "Your password must be at least 5 characters long"
            },
            wachtwoord2: {
                required: "Please provide a password",
                minlength: "Your password must be at least 5 characters long",
                equalTo: "Please enter the same password as above"
            },
            email: "Please enter a valid email address"
        }
    });
});
</script>

I get the error:

Uncaught TypeError: Cannot read property 'nodeType' of undefined

in the console.

Any idea what goes wrong?

2
  • The markup is invalid. The closing </div> above <div class="row-fluid bottompad"> has no corresponding opening <div> Commented Jun 29, 2017 at 15:28
  • Tnx but I copied the code wrong, the closing </div> is not really in my source code. I will adjust the post .... ;-) Commented Jun 30, 2017 at 7:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.