Form gets submitted twice on button click
<p>I have called below javascript function on </p>

<pre><code>function formOnSubmit() {
    if (document.forms[0].ref_no.value == "") {

        if (document.forms[0].acc_code.value == "") {

            if (document.forms[0].vendor_code.value == "") {

                if (document.forms[0].acc_service_tax.value == "") {

                    if (document.forms[0].acc_doc_name.value == "") {
                        alert('Please enter atleast one attribute value');
                        return false;
                    }
                }
            }

        }
    } else {
              return true;
        document.forms[0].submit();

    }
}
</code></pre>

<p>where,
ref_no,acc_code,vendor_code,acc_service_tax,acc_doc_name are textboxes</p>

<p>The problem is form gets submitted twice when I enter something in ref_no texbox and form submitss once for the rest of textboxes.</p>

<p>I want to know why form gets submitted twice when I enter ref_no value.</p>
