Conditional Rule Validation in JQuery
<p>I am using <a href="http://docs.jquery.com/Plugins/Validation#API%5FDocumentation" rel="nofollow">JQuery Validation</a>. Now I want my rules to be invoked only when certain condition is satisfied, namely, I want <code>$("#AppSelectField").is(':hidden')</code> to return <code>false</code>, only then I invoke the rules.</p>

<p>My rules is as follow:</p>

<pre><code>$(function() {
    $("#RequestLock").validate({
        rules: {
        FloorNum:{
        required: true,
        digits: true
        },


    },
    message: {
     FloorNum: "The floor number must be integer",

},

});
});
</code></pre>

<p>How to modify the above section to satisfy my needs? <strong>Note I don't want to write my own custom method for <code>required</code> and <code>digits</code>.</strong> </p>
