Validate Problem

Validate Problem

Hi!
EDIT:
I got it working! But now I'm stuck with another problem, the form action won't happen, I did set it to "?register=send", so it should rederict me to register.php?register=send (works if I remove javascript code and hits submit.)

Why won't it submit?
Code:
<? include'includes/mysqlConnect.php'; ?>

<? include'includes/head.php'; ?>

<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>

<script type="text/javascript">
jQuery.validator.setDefaults({
   debug: true,
   success: "valid"
});
</script>

<script type="text/javascript">
   $(document).ready(function() {
       var validator = $("#form1").validate({
           rules: {
               username:
                {
                     required: true,
                     minlength: 3
                 },
             password1:
                {
                     required: true,
                        minlength: 6    
                   },
               password2:
                {
                   required: true,
                  minlength: 6,
                       equalTo: "#password1"
                   },
               email:
                 {
                       required: true,
                       email: true
                    },
           },
       });
   });
</script>
   
<style type="text/css">
   input.valid {
   border: 1px solid blue;
   }
   input.error {
   border: 1px solid red;
   }
   
   label.error {
      background: url('style/icon/cross.png') no-repeat;
      padding-left: 16px;
      margin-left: .3em;
   }
   label.valid {
      background: url('style/icon/tick.png') no-repeat;
      padding-left: 16px;
      margin-left: .3em;
   }
   #form {
   width:400px;
   }
   input{
   float:left;
   }
</style>

<? include'includes/firstBodyHalf.php'; ?>
    <form id="form1" method="post" action="?register=send">
       <div id="form">
            <h4>Username</h4>
             <input type="text" id="username" name="username" />
                 <br><br>
          <h4>Password</h4>
             <input type="text" id="password1" name="password1" />
                 <br><br>
          <h4>Password Confirmation</h4>
             <input type="text" id="password2" name="password2" />
                 <br><br>
           <h4>Email</h4>
             <input type="text" id="email" name="email" />
                <br><br>
           <input class="submit" id="submit" type="submit" name="submit" value="Submit" />
             <br>
        </div>
   </form>

<? include'includes/secondBodyHalf.php'; ?>


I did try to add
submitHandler: function(form) {
     form.submit();
});

Without luck unfortunaly..

Edit Done.


I have now for a long time been wondering why my script for validating my registration form doesn't work. I basically just want it to validate all the fields, and then submit to get my PHP code to submit the user to the database. Everything works fine, EXCEPT when it tries to confirm the passwords with the EqualTo command, I just get "please enter the same value", screenshot:
Image

And here is my JavaScript code:
     <script type="text/javascript">
       $(document).ready(function() {
         $("#form1").validate({
           rules: {
             username: {
             required: true,
             minlength: 3
           },
           password1: {
             required: true,
                minlength: 6    
             },
             password2: {
               equalTo: "#password1"
             },
             email: {
               required: true,
               email: true
              },
           },
         });
       });
   </script>


Code for all the document:

<? include'includes/mysqlConnect.php'; ?>

<? include'includes/head.php'; ?>

  <script type="text/javascript" src"http://dev.jquery.com/view/trunk/plugins/validate/lib/jquery.delegate.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>

  <script type="text/javascript">
jQuery.validator.setDefaults({
   debug: true,
   success: "valid"
});;
</script>

     <script type="text/javascript">
       $(document).ready(function() {
         $("#form1").validate({
           rules: {
             username: {
             required: true,
             minlength: 3
           },
           password1: {
             required: true,
                minlength: 6    
             },
             password2: {
               equalTo: "#password1"
             },
             email: {
               required: true,
               email: true
              },
           },
         });
       });
   </script>
   
     <style type="text/css">
   input.submit {
   float: none;
   }
   
   input.error {
   border: 1px solid red;
   }
   
   label.error {
      background: url('style/icon/cross.png') no-repeat;
      padding-left: 16px;
      margin-left: .3em;
   }
   label.valid {
      background: url('style/icon/tick.png') no-repeat;
      padding-left: 16px;
      margin-left: .3em;
   }
   #form {
   width:400px;
   }
   input{
   float:left;
   }
     </style>

<? include'includes/firstBodyHalf.php'; ?>
    <form id="form1" method="post" action="?sucess=1">
   <div id="form">
          <h4>Username</h4><input type="text" name="username"><br><br>
        <h4>Password</h4><input type="text" name="password1"><br><br>
        <h4>Password Confirmation</h4><input type="text" name="password2"><br><br>
         <h4>Email</h4><input type="text" name="email"><br><br>
         <input class="submit" type="submit" value="Submit">
    </div>
       </form>

<? include'includes/secondBodyHalf.php'; ?>


Hope someone can help me out.

- Sirupsen