Using a variable in jQuery validation -


i validate field max number , works great:

jquery.validator.setdefaults({   debug: true,   success: "valid" }); $( "#registration" ).validate({   rules: {   max_number: {   required: true,   max: 3     }    }   }); 

what replace max: 3 variable have been using (available_seats). works fine number there, when use variable (value of 10) doesn't work @ all. suggestions?

jquery.validator.setdefaults({   debug: true,   success: "valid" }); $( "#registration" ).validate({   rules: {     max_number: {       required: true,       max:available_seats     }   } }); 

converting variable int with:

    parseint(available_seats) 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -