Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Regarding your code:</p> <pre><code>$(".text").editable("/Course/RubricsEdit", { submitdata: function (settings, td) { var input = $(td).find('input'); $(this).validate({ // &lt;-- this is in the wrong place rules: { 'nameofinput': { number: true } }, messages: { 'actionItemEntity.name': { number: 'Only numbers are allowed' } } }) return ($(this).valid()); } }); </code></pre> <p>Part of your problem is that you are trying to manually apply jQuery Validation to each <code>input</code> using <code>.validate()</code>.</p> <p><a href="http://docs.jquery.com/Plugins/Validation/validate#options" rel="nofollow"><code>.validate()</code></a> is only supposed to be used <em>once</em> within DOM ready to <strong>initialize</strong> the plugin on the <em>form</em>, <strong>not</strong> for validating each field manually. The plugin takes care of all field validations automatically.</p> <p><a href="http://docs.jquery.com/Plugins/Validation/valid" rel="nofollow"><code>.valid()</code></a> can then be used, <em>after</em> <code>.validate()</code> is initialized, to force a validation test on the form and/or return the corresponding boolean value of the result (for the whole form).</p> <p>I also noticed that the name of your input <code>'nameofinput'</code>, does not match the corresponding <code>'actionItemEntity.name'</code> within <code>messages: {}</code>. These must be the same if that's the corresponding message you're trying to over-ride. (<a href="http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_complex_names_.28brackets.2C_dots.29" rel="nofollow">You only need quotes around the input <code>name</code> if it contains special characters like periods and brackets.</a>)</p> <p>Something like this to get you back on track:</p> <pre><code>$(document).ready(function() { $('#yourform').validate({ rules: { nameofinput: { number: true } }, messages: { nameofinput: { number: 'Only numbers are allowed' } } }); }); </code></pre> <p><strong>Simple Demo</strong>: <a href="http://jsfiddle.net/Hr3bB/" rel="nofollow">http://jsfiddle.net/Hr3bB/</a></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.
    1. This table or related slice is empty.
    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