开发者

Callback/validation tips for jeditable

开发者 https://www.devze.com 2023-02-24 12:23 出处:网络
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

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 h开发者_运维技巧ow to check text as it's being inputed via onChange.

Thx


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;
        }
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号