Question

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?

Was it helpful?

Solution

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

OTHER TIPS

should you have a comma after the sumbitHandler declaration?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top