Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Validation Plugin - Challenge you to figure this out (help?)
    primarykey
    data
    text
    <p>Simple enough, why the heck isn't this working...? jQuery 1.6.2 is included in the head as well, above this. It's not triggering validation, now it just goes straight through and says "Submitted" without even validating the fields.</p> <p>The validation in the head:</p> <pre><code>&lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/additional-methods.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#newcontract").validate({ rules: { rec_name: { required: true } }, messages: { rec_name: { required: 'You need to enter a contract receiver.' } }, submitHandler: function() { alert("Submitted!"); } }); }); &lt;/script&gt; </code></pre> <p>Form is named newcontract, so what am I missing:</p> <pre><code>&lt;form name="newcontract" id="newcontract" method="post"&gt; &lt;input type="text" name="rec_name" id="rec_name" size="42" class="required"/&gt; &lt;tr&gt;&lt;td class="submit" colspan="3"&gt;&lt;input type="submit" name="savelisting" id="savelisting" value="Save New Contract" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/form&gt; </code></pre> <p>What's going on? It won't validate this text field. Help!!</p> <p><strong>UPDATE: The code above works as expected. The issue lied within the fact that I removed a table that was wrapping my form, and the validation plugin was skipping the form. As soon as I moved the form outside the table in my HTML, it worked fine.</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload