这个问题通常表明提交按钮没有被正确地链接到表单的提交处理程序。解决方法可以是重定向页面或重新编写代码来正确链接提交按钮:
HTML代码示例:
AJAX代码示例:
$('#submitBtn').click(function(e) { e.preventDefault(); // 防止表单提交 $.ajax({ type: "POST", url: "process.php", data: $('#myForm').serialize(), // 序列化表单数据 success: function(response) { alert('Your message has been sent!'); // 提示成功发送消息 window.location.href = "thank-you-page.html"; // 重定向到感谢页面 }, error: function(xhr, status, error) { console.log(xhr.statusText); // 在控制台打印错误消息 } }); });