Mozilla中未填充值 [英] Value not populating in Mozilla

查看:85
本文介绍了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()"/> 

推荐答案

这句话确实 doesn''t 很有意义:对于所有警报,值未填充,但对于咖啡杯文本框值未填充",因为这是合乎逻辑的事情.
如果警报显示没有任何价值,那么为什么您会期望文本框中填充任何内容?

请澄清!

干杯,
This sentence does doesn''t make sense: "For all alerts value is not populated but for cug text box value is not populated" as it is the logical thing to happen.
If the alerts show that there is no value then why would you expect that the text box would be filled with anything?

Please clarify!

Cheers,


请尝试以下操作:

Please try it like this:

<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中未填充值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆