With two <form>'s on a page, how to you make jQuery only run the functions on one (without using IDs)?
<p>Now I know this sounds elementary, but I honestly can't dial this in. I have two forms on a single page. I wrote some form validating functions that are triggered as such: </p>

<pre><code>$("form").submit(function(event) {
    event.preventDefault();
    checkRequired();
    checkLengths();
    checkFormats();
    checkErrors();
});
</code></pre>

<p>This is awesome, but inside the functions, I cannot use <code>$(this)</code> to identify the <code>&lt;form&gt;</code> from which the submit button was clicked.</p>

<p>Let's say I wrote <code>alert($(this).attr('id'));</code> in the <strong>checkRequired()</strong> function. It alerts "<strong>Object, object</strong>".</p>

<p>If I place the same code inside the <code>$("form").submit()</code> function, it returns my form's id.</p>

<p>The selectors inside the functions are things like <code>$("input[type='text']")</code> and similar, but the functions run on all the inputs, not just the ones in the form that was submitted.</p>

<p><strong>Sample function() used:</strong></p>

<pre><code>function checkFormats() {

    alert("Checking Formats...");

    $(".email").each(function(){

        alert("Checking Formats: Email...");

        var emailField = $(this).children("input[type='text']");
        var strEmail = emailField.val();

        if( strEmail.indexOf( "@" ) == -1 ) {
            alert("What the hell?");
        }

    });

}
</code></pre>

<p>I'm sure I'll feel dumb when I hear the solution, but hey, I'm overly-tired lol... Thanks in advance!</p>

<p><strong>Thinking maybe <code>$("form",this)</code> may get me somewhere?</strong></p>
