0

Any tips for form validation using jeditable. I would like to have the script POSTed to pass back errors with JSON, with the submitted text but can't seem to figure that one out, if even possible. Or how to check text as it's being inputed via onChange.

Thx

maxum
  • 2,825
  • 4
  • 33
  • 49
  • great solution here http://stackoverflow.com/questions/2223747/jeditable-how-to-handle-a-json-response/4611865#4611865 – maxum Apr 13 '11 at 09:55

1 Answers1

0

Here is a simple sample, but not used jQuery Validation.

function isNumeric(value) {
  if (value == null || !value.toString().match(/^[-]?\d*\.?\d*$/)) return false;
  return true;
}

$('.edit').editable(your_url, {
    onsubmit: function(settings, original) {
        if (isNumeric(original)) {
            return true;
        } else {
            //display your message
            return false;
        }
    }
});