Why does the JQuery valid() method always return True?
<p>I have a simple HTML form:</p>

<pre><code>&lt;form id="frmNewCategory"&gt;
    &lt;span&gt;New Category Name:&lt;/span&gt;
    &lt;input type="text" id="txtNewCategoryName"&gt;
    &lt;label&gt;Amount:&lt;/label&gt;
    &lt;input type="text" id="txtNewCategoryAmount"&gt;
    &lt;br&gt;
    &lt;input type="submit" value="Create" class="importantButton button" id="btnNewCategory"&gt;
    &lt;input type="button" value="Cancel" class="button" id="btnCancelNewCategory"&gt;
&lt;/form&gt;
</code></pre>

<p>And a bit of jquery-driven javascript that fires when btnNewCategory is clicked:</p>

<pre><code>function onNewCategoryClick(event)
{

    $("#frmNewCategory").validate(
        {
            rules:
            {
                txtNewCategoryName : { required: true },
                txtNewCategoryAmount : { required: true, number: true }
            },
            messages:
            {
                txtNewCategoryName : { required: "*" },
                txtNewCategoryAmount: { required: "*", number: "Invalid Amount." }
            }
        });


    if (!$("#frmNewCategory").valid())
        return;

    event.preventDefault();
    var cmd = cmdFactory.createUndoableNewCategoryCommand($(this));
    cmdBus.handleCommand(cmd);  
}
</code></pre>

<p>The method above is supposed to validate frmNewCategory. Trouble is that even if the form has invalid values or no values at all the .valid() method still returns True.</p>

<p>Any ideas? What am I doing wrong?</p>
