9
在页面中我有一个链接;点击它打开一个对话框并设置该对话框的文本框值。在回发中丢失文本框值
但是,一旦我点击了在该对话框中提交,文本框的值为空。
链接:
<a href="#" onclick="javascript:expand('https://me.yahoo.com');
jQuery('#openiddialog').dialog('open'); return false;">
<img id="yahoo" class="spacehw" src="/Content/Images/spacer.gif" /></a>
脚本:
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#openiddialog").dialog({
autoOpen: false,
width: 600,
modal: true,
buttons: {
"Cancel": function() {
$(this).dialog("close");
}
}
});
});
function expand(obj) {
$("#<%=openIdBox.ClientID %>").val(obj);
}
对话框:
<div id="openiddialog" title="Log in using OpenID">
<p>
<asp:Label ID="Label1" runat="server" Text="OpenID Login" />
<asp:TextBox ID="openIdBox" EnableViewState="true" runat="server" />
<asp:JButton Icon="ui-icon-key" ID="loginButton" runat="server" Text="Authenticate" OnClick="loginButton_Click" />
<asp:CustomValidator runat="server" ID="openidValidator" ErrorMessage="Invalid OpenID Identifier" ControlToValidate="openIdBox" EnableViewState="false" OnServerValidate="openidValidator_ServerValidate" />
<br />
<asp:Label ID="loginFailedLabel" runat="server" EnableViewState="False" Text="Login failed" Visible="False" />
<asp:Label ID="loginCanceledLabel" runat="server" EnableViewState="False" Text="Login canceled" Visible="False" />
</p>
</div>
选择一个基于ID的元素...如果我没有弄错..即使你删除了散列,它的类选择器 – 2010-06-09 08:26:06
我忘记了它是JQuery – Kate 2010-06-09 08:34:26
对不起,但是什么是? –
Kate
2010-06-09 10:52:04