views:

99

answers:

2

The following code doesn't work.

$(document).ready(function(){ 
        $("#digitalchange").validate(
        { 
            rules: { 
             addbalance: {
                digits:true,
                min:20,
                max:1000

            },
             addquota: {
                digits:true,
                min:5,
                max:1000    

            }
         }, 
            submitHandler: function(){

      var var1=$("#addbalance").val();
        alert(var1);
        }
              messages: { 


            }
        }); 
     });

However, after I remove

submitHandler: function(){

          var var1=$("#addbalance").val();
            alert(var1);
            }

, the remaining code works. What's wrong?

+1  A: 

should you have a comma after the sumbitHandler declaration?

bobwah
+2  A: 

You're missing a comma after the closing } of the submitHandler value function?

djc
You are right.Thanks.
Steven
:( I answered this first!
bobwah