我有一张textarea表格。我使用jquery.textntags用于facebook类型提及功能正常。但是当我通过ajax提交表单时,textarea内容会发生变化。以下是示例:
$('#wall-post-form').on('beforeValidate', function (event, messages, deferreds) {
console.log('Before validate: '+$('#wallpostform-content').val());
// prints Before validate: @[[2:contact:Daniel Radcliffe]] how are you?
}).on('beforeValidateAttribute', function (event, attribute, messages, deferreds) {
console.log('Before validate attribute: '+$('#wallpostform-content').val());
// prints Before validate attribute: @[[2:contact:Daniel Radcliffe]] how are you?
}).on('afterValidateAttribute', function (event, attribute, messages) {
console.log('After validate attribute: '+$('#wallpostform-content').val());
// prints After validate attribute: @[[2:contact:Daniel Radcliffe]] how are you?
}).on('afterValidate', function (event, messages) {
console.log('After validate: '+$('#wallpostform-content').val());
// prints After validate: @[[2:contact:Daniel Radcliffe]] how are you?
}).on('beforeSubmit', function () {
console.log('Before submit: '+$('#wallpostform-content').val());
// prints Before submit: @[[2:contact:Daniel Radcliffe]]iel Radcliffe]] how are you?
return false;
});
正如您所看到的,textarea值在beforeSubmit event
中得到了更改。我无法理解为什么会这样。有什么想法吗?