jQuery, JavaScript - How to create function that checks if form is submitted
<p>I have this code:</p>

<pre><code>if($('input[name=id]').length == 1 &amp;&amp; $('input[name=submitted]').length != 1 )
    {
    var id = $('input[name=id]').val(),
    name =  $('input[name=staro_ime]').val();
    img_upload(name, id);
    }
</code></pre>

<p>When form is submitted, hidden input field with name <strong>submitted</strong> is created. How can I check when form is submitted and then disable code from above?(This function is outside <strong>submit_event</strong>).</p>
