【发布时间】:2014-10-10 01:38:37
【问题描述】:
我正在像这样在 jquery 模态对话框中打开一个视图
$("a.OpenView").on('click', function () {
></div>")
.addClass("dialog closePopup")
.attr("id", "popup1")
.appendTo("body")
.load("../../ControllerName/_partialView")
.dialog({
title: "LogIn",
modal: true,
height: "auto",
minHeight: 260,
maxHeight: 260,
width: 450,
left: 0,
zIndex: 1001
});
});
HTML
<table cellpadding="0" cellspacing="0">
<tr>
<td align="center"><input name="" type="text" value="" title="User Name" class="width190" id="txtUserName" onfocus="txtFocus(this)" onblur="txtFBlur(this,'0')"/></td>
<td align="center"><input name="" type="password" value="" title="Password" class="width190" id="txtPassword" onfocus="txtFocus(this)" onblur="txtFBlur(this,'1')"/></td>
</tr>
<tr>
<td colspan="2" align="center"><input name="" type="submit" class="blue_btn" value="Sign In" id="btnLogIn" onclick="javascript:return LogIn()"/></td>
</tr>
</table>
现在,一旦我关闭对话框,然后我再次重新打开它并输入用户名和密码...我得到 "" 作为两个文本框的值...
这可能是什么原因,我做错了什么?
登录功能在这里
function LogIn() {
var username = $('#txtUserName').val();
var password = $('#txtPassword').val();
}
【问题讨论】:
标签: javascript jquery asp.net-mvc-3 jquery-dialog