Prevent form from submit w/ jQuery
<p>I have a page that displays data. A user can click "edit" button and the text displays within a form. Basically I hide form and on click toggle text to hide and form to show. I need to make sure that the form can not be submitted, via page refresh or clicking Enter key, until it is visible and the user clicks submit button.</p>

<p>How do I do that? </p>

<pre><code>$("#dataForm").hide();

$("#editData").click(function() {
    $("#dataForm").toggle();
    $("#dataText").toggle();
});


&lt;div id="dataForm"&gt;
    &lt;label&gt;Label 1&lt;/label&gt;
    &lt;input type="text"&gt;

    &lt;label&gt;Label 2&lt;/label&gt;
    &lt;input type="text"&gt;

    &lt;input type="submit"&gt;
&lt;/div&gt;


&lt;div id="dataText"&gt;
    Label 1: abc
    &lt;br&gt;
    Label 2: 123
    &lt;br&gt;
    &lt;span id="editData"&gt;Edit&lt;/span&gt;
&lt;/div&gt;
</code></pre>
