【发布时间】:2022-01-26 12:42:49
【问题描述】:
如果检查成功,我如何序列化和发布数据。
标准验证javascript:
(function () {
'use strict'
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.querySelectorAll('#contact-form')
// Loop over them and prevent submission
Array.prototype.slice.call(forms)
.forEach(function (form) {
form.addEventListener('submit', function (event) {
if (!form.checkValidity()) {
event.preventDefault()
event.stopPropagation()
}
form.classList.add('was-validated')
}, false)
})
})();
【问题讨论】:
-
到目前为止你尝试了什么?
-
ajax 帖子。但没有用。
标签: javascript php ajax