我有一个像这样的简单表格:
<form method="post" name="change_pass" id="change_pass" action="change_pass2.php">
<input type="hidden" id="uid" value="<?php echo $userid ?>">
<div id="dialog" style="display:none">
<input type="text" name="pass" id="pass">Password :
<input type="text" name="conf_pass" id="conf_pass">Confirm Password:
</div>
</form>
<div id="weak" style="display:none" title="Weak password">
<p >Please make sure your password is atleast 8 characters</p>
</div>
<div id="mismatch" style="display:none" title="Failure">
<p>Password mismatch</p>
</div>
</body>
</html>
我正在使用 jquery ui 的对话功能来创建这样的对话表单,
$(function(){
$('#dialog').dialog({
title : 'You must change your password',
modal : true,
closeOnEscape: false,
dialogClass: 'no-close',
resizable: false,
draggable: false,
buttons: {
'Change Password' : function() {
if ( $('#pass').val().length < 8 || $('#pass').val() == 'dantours') {
$('#weak').dialog();
}
else if ( $('#pass').val() != $('#conf_pass').val()){
$('#mismatch').dialog();
}
else
$('#change_pass').submit();
}
}
});
});
但是在 change_pass2.php 页面上,$_POST 数组是空的。我一直把头靠在显示器上试图弄清楚这一点。