0
使用可调整的表单验证的任何提示。我想让POST的脚本用JSON传回错误,并提交文字,但如果可能的话,似乎无法找出答案。或者如何检查文本,因为它是通过onChange输入的。可回拨的回拨/验证提示
THX
使用可调整的表单验证的任何提示。我想让POST的脚本用JSON传回错误,并提交文字,但如果可能的话,似乎无法找出答案。或者如何检查文本,因为它是通过onChange输入的。可回拨的回拨/验证提示
THX
下面是一个简单的示例,但不使用jQuery验证。
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;
}
}
});
伟大的解决方案在这里http://stackoverflow.com/questions/2223747/jeditable-how-to-handle-a-json-response/4611865#4611865 – maxum 2011-04-13 09:55:21