【发布时间】:2016-05-19 06:26:08
【问题描述】:
我有一个菜单栏子菜单,需要导航到特定链接。但是在导航到链接之前,我需要打开一个 jquery 对话框作为登录表单以输入用户名和密码。提交用户名和密码时,我需要链接到导航到特定目的地..
这里的问题是,在单击子菜单时,它既没有打开 jquery 对话框登录表单,也没有导航到特定站点..
这是我用于菜单栏的 html..
<li><a href="#"><span>Settings</span></a>
<div><ul>
<li><a href="Createuser.jsp" class="loginlink"><span>Create New Account</span></a></li>
</ul></div>
</li>
这是我的 jquery 登录表单...
<a href="/login" style="display:none" class="loginlink">Log In</a>
<div id="loginform" style="display:none">
<form action="Createuser.jsp" method="post">
<table>
<tr>
<td>User Name:</td>
<td>
<input name="username" id="username" type="text" />
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input name="password" id="password" type="password" />
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center;">
<input type="submit" value="Login" />
</td>
</tr>
</table>
</form>
</div>
下面是我的document.ready函数..请看..
$('a.loginlink').click(function(e) {
e.preventDefault();
$('#loginform').dialog('open');
e.preventDefault();
return false;
});
$('#loginform').dialog({
autoOpen: false,
modal: true,
resizable: false,
draggable: false
});
【问题讨论】:
标签: jquery html css jquery-ui-dialog