本文介绍了Mozilla中未填充值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在ASP.NET中,我有一个文本框和一个弹出的搜索窗口,该窗口检索带有link的数据.当我选择链接窗口时,将关闭,但值不会在mozilla的文本框中填充.
In ASP.NET, I have a textbox and a pop up search window which retrieves data with a link . When I selected the link window is closing but value is not populated in the text box for mozilla.
<script type="text/javascript">
<!-- #include file="../jscripts/script368.js" -->
function newSearchWindow()
{
cugval = window.showModalDialog(''CUGSearch.aspx'',''CUGSearch'',''dialogWidth:900px;dialogHeight:600px;center:yes;status:no;'');
if (cugval != "")
{
alert(cugval);
document.forms[0].elements["<%=cugcode.ClientID%>"].value = cugval;
alert( document.forms[0].elements["<%=cugcode.ClientID%>"].value);
document.forms[0].submit();
}
}
</script>
对于所有警报,值均已填充,但对于杯式文本框,则未填充值.
For all alerts value is populated but for cug text box value is not populated.
<input type="text" id="cugcode" class="text" size="20" name="cugcode" runat="server" onchange="submit()"/>
推荐答案
<script type="text/javascript" >
<!-- #include file="../jscripts/script368.js" -->
function newSearchWindow()
{
cugval = window.showModalDialog('CUGSearch.aspx','CUGSearch','dialogWidth:900px;dialogHeight:600px;center:yes;status:no;');
if (cugval != "")
{
alert(cugval);
var element = document.getElementById("<%=cugcode.ClientID%>");
element.value = cugval;
alert( element.value);
document.forms[0].submit();
}
}
</script>
希望有帮助!
Hope that helps!
这篇关于Mozilla中未填充值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!