验证码在服务器上不受支持. [英] Validation code is not suuported on server.
问题描述
专家,
我已经开发了一个asp.net应用程序.
对于一种形式,我使用javascript添加了验证代码.
在我的本地主机上,它可以正常工作.但是在专用服务器上,它不能工作.
我的表单代码如下
Hi Expert,
I have develop one asp.net application.
For one form i have add validation code using javascript.
on my local host its working properly .But on dedicated server its not working.
my form code is following
<form name="frmquicksearch" method="post" action="search.aspx">
<table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="25"> <div align="right"><font color="#666666" size="1" face="Verdana, Arial, Helvetica, sans-serif">Search:</font></div></td>
<td width="110"> <div align="center">
<input type="text" class="fieldtext2" name="data">
</div></td>
<td width="25"> <div align="center">
<input type="button" name="Submit2" value="Go" onclick="return Validate1();">
</div></td>
</tr>
</table>
</form>
javascript代码为
javascript code is
function Validate1()
{
if (frmquicksearch.data.value=="" )
{
alert("Please Enter Search Keyword");
frmsearch.data.focus();
return false
}
else
return true;
}
</script>
以上代码适用于Google chrome,但不适用于Mozilla浏览器
背后的问题是什么.
在此先感谢
and above code is working for Google chrome but not in Mozilla browser
what is the problem behind it.
Thanks in advance
推荐答案
我现在更新了您的代码检查
Hi,
I updated your code check now
<form name="frmquicksearch" id="frmquicksearch" method="post" action="search.aspx">
<table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="25">
<div align="right">
Search:</div>
</td>
<td width="110">
<div align="center">
<input type="text" class="fieldtext2" name="data" id="data">
</div>
</td>
<td width="25">
<div align="center">
<input type="button" name="Submit2" id="Submit2" value="Go" onclick="return Validate1()">
</div>
</td>
</tr>
</table>
</form>
而javascript是
And javascript is
function Validate1() {
if (document.getElementById("data").value == "") {
alert("Please Enter Search Keyword");
document.getElementById("data").focus();
return false
}
else
return false;
}
所有浏览器都不遵循相同的规则,某些供应商遵循某些属性.
因此,我们必须维护跨浏览器的属性.
最好的
all browsers are not follow same rules some vendors follow some properties.
So,we''ve to maintain cross browser properties.
All the Best
这篇关于验证码在服务器上不受支持.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!