2
我正在使用Bootstrap驗證器,我遇到的問題是我希望在所有值都有效後啓用提交按鈕,但無法這樣做。在Bootstrap驗證器中啓用提交按鈕
$(document).ready(function() {
$('#ans_frm').bootstrapValidator({
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
submitButtons: 'button[type="submit"]',
fields: {
ans: {
group: '.col-md-8',
validators: {
stringLength: {
min: 3,
max: 100,
message: 'The answer must be more than 2 and less than 100 characters long'
},
notEmpty: {
message: 'The answer must not be empty'
}
}
}
}
}).on('status.field.bv', function(e, data) {
disableSubmitButtons(false);
}
});
});
它確實值傳送到下一個頁面,但它並不validate.The按鈕啓用所有的時間甚至當值不正確。 – Umerm 2014-11-09 18:26:32