我想在提交表格后弹出一个div
我想在提交表单后弹出#popUpDiv
脚本
$(document).ready(function(){ $('#form').on('submit',function(e){ e.preventDefault(); $.post('post.php', $(this).serialize(), function(response){ $('#result').html(response); $('#popUpDiv').fadeIn(); } }); });
表格代码如下
结果将显示在此处
完整代码在这里:post.php
$(document).ready(function(){ $('#form').on('submit',function(e){ e.preventDefault(); $.post('post.php', $(this).serialize(), function(response){ $('#result').html(response); $('#popUpDiv').fadeIn(); } }); });
更新此脚本函数未在脚本中正确关闭
我解决了这个问题,看看我做了什么,这就是post.php
这是result.php
Your Number: ' .$_POST['number']."