Php jquery对话框
我正在做一个登录表单。 这是密码Php jquery对话框,php,jquery,dialog,Php,Jquery,Dialog,我正在做一个登录表单。 这是密码 <?php require_once('../../SfHelper.php'); $sfHelper = new SfHelper(); echo $sfHelper->load_css('ui-lightness/login'); ?> <div name="form_Login" class="form_Login"> <form id="form1" name="form1" method="
<?php
require_once('../../SfHelper.php');
$sfHelper = new SfHelper();
echo $sfHelper->load_css('ui-lightness/login');
?>
<div name="form_Login" class="form_Login">
<form id="form1" name="form1" method="post" action="<?php echo
$sfHelper->base_url().'forms/jobseeker/'; ?>process_Login.php" >
<table width="296" border="0" align="center" cellspacing="5">
<tr>
<td colspan="3">LOGIN JOB SEEKER</td>
</tr>
<tr>
<td width="110">Username</td>
<td width="18">:</td>
<td width="209"><input type="text" name="txtUsername"
id="txtUsername" /></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input type="password" name="txtPassword" id="txtPassword" /></td>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td colspan="3"><div align="center">
<input type="submit" name="Login" id="Login" value="Login" />
</div></td>
</tr>
</table>
</form>
</div>
<?php
if(isset($_GET['err']))
{
if($_GET['err'] == "Sorry, We Cannot found your Username")
{
echo '<script type="text/javascript">
alert("Sorry, We Cannot found your Username"); </script>';
}
else if($_GET['err'] == "Invalid Username or Password")
{
echo '<script type="text/javascript">
alert("Invalid Username or Password");</script>';
}
}
?>
在页面完全加载之前,您需要添加“就绪”
$(document).ready(function() {
// Code using $ as usual goes here.
//The DOM is now loaded and can be manipulated.
});
echo '<script type="application/javascript">
$(document).ready(function() {
$("#Login").click(function() {
$( "#dialog-message" ).dialog({
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
}
});
});
});
</script>';
$(文档).ready(函数(){
//像往常一样使用$的代码出现在这里。
//DOM现在已加载,可以进行操作。
});
回声'
$(文档).ready(函数(){
$(“#登录”)。单击(函数(){
$(“#对话框消息”).dialog({
莫代尔:是的,
按钮:{
好的:函数(){
$(此).dialog(“关闭”);
}
}
});
});
});
';
您应该转到
<div id="dialog-message" style="display:none" >
<p>
<span class="ui-icon ui-icon-circle-check"
style="float:left; margin:0 7px 50px 0;"></span>
Sorry, We Cannot found your Username
</p>
</div>
<div id="dialog-message2" style="display:none" >
<p>
<span class="ui-icon ui-icon-circle-check"
style="float:left; margin:0 7px 50px 0;"></span>
Invalid Username or Password
</p>
</div>
$(document).ready(function() {
// Code using $ as usual goes here.
//The DOM is now loaded and can be manipulated.
});
echo '<script type="application/javascript">
$(document).ready(function() {
$("#Login").click(function() {
$( "#dialog-message" ).dialog({
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
}
});
});
});
</script>';