views:

66

answers:

1

Hi i am using jquery validate that works fine in FF but IE dont listen the rules and dont submit.

Here is the code

$(document).ready(function() {

        $("form#loginForm").validate({
         submitHandler: function(form){
             customer_dispatch('login');
            },
            rules: {
    user_login: { required: true },
    user_password: { required: true },             
            },
            messages: { } 
        });

})

AND THE FORM

<table cellpadding="0" cellspacing="0" border="0" width="100%" class="login-table">
 <tr valign="top">
  <td width="50%" class="login">
   <h2 class="subheader">Είσοδος Χρήστη</h2>

  <form name="loginForm" id="loginForm" method="post" >
  <input type="hidden" id="do" name="do" size="10" value="login" />
  <div id="form_container" >
  <ul>
   <li id="li_1" >
     <label class="description" for="lastLabel">Όνομα Χρήστη :</label>
     <input id="user_login" name="user_login" class="element text medium" type="text" maxlength="255" value=""/> 
   </li>  
   <li id="li_2" >
     <label class="description" for="lastLabel">Κωδικός :</label>
     <input id="user_password" name="user_password" class="element text medium" type="password" maxlength="255" value=""/>  
   </li> 
  </ul>
  </div><!--form_container-->

  <div class="clear">
   <div class="buttons-container right">    
    <span  class="button-submit-action"><input class="hand" type="submit" value="Sign in" /></span>
   </div>
  </div>


  </form>

 </td><!--form login-->

IN FF works perfect. I am using the jquery and validate file from the demo.When running the demo works in IE.

Am i missimg somethig Thanks

+4  A: 

It's the trailing comma here :

user_password: { required: true },

Remove that and it should work.

Jimmeh
He asked if he was *missing* something. Your answer only applies if he has something *overrun* ;) +1 for the spot on nevertheless.
BalusC
YES IT IS. Thank for your reply, you saved mu life
ntan
No probs :) I've done it loads of times, that's why i was quick to spot it :p
Jimmeh
This occurs a lot because languages like c# let you use the comma in a structure like this.
Mark Schultheiss