问题描述
大家好,
我的应用程序中有一个简单的客户端计算.
情况就像,
我有3个文本框.说txt1,txt2,txt3.
txt3 = txt1 + txt2
我的javascript工作正常,就像
HI All,
I have a simple client side calculation in my application.
Situation is like,
I have 3 textboxes. Say txt1,txt2,txt3.
txt3 = txt1 + txt2
my javascript works fine which is something like
document.getElementbyID('<%=txt3.ClientID%>').value = Number(document.getElementbyID('<%=txt1.ClientID%>').value) + Number(document.getElementbyID('<%=txt2.ClientID%>').value);
我在客户端得到结果.但是,当我在服务器端代码中编写txt3.text时,我什么也没得到.
txt3是只读的,我试图将其设置为readonly,但工作正常,但如何将其设置为true呢?
请有人可以帮助我....
在此先感谢您.
I get result on client side. But when i write txt3.text in server side code i get nothing.
txt3 is readonly i tried to make it readonly false and it worked fine but how can I make it with readonly true?
Please some one can help me....
Thanks in advance.
推荐答案
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Simple Querystring Debugging</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
Just a simple check for the query string!</br>
</body>
<script type="text/javascript">
document.write("<b>Querystring:</b> " + document.location.search);
</script>
</html>
ReadOnly.html包含小型测试HTML标记:
ReadOnly.html contains the small test HTML markup:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body onload="init();">
<form id="testForm" method="GET" action="./DebugQuery.html">
<input ID="test" NAME="realname" VALUE="Hi There" READONLY>
<input ID="submit" type="submit" name="submit" value="Send!">
</form>
<input ID="doit" type="button" NAME="doIt" VALUE="Set to 10!" onclick="doIt();">
</body>
<script type="text/javascript">
function init()
{
var test = document.getElementById("test");
test.value = "0";
}
function doIt()
{
var element = document.getElementById("test");
element.value = 10;
}
</script>
</html>
问候,
Manfred
Regards,
Manfred
document.getElementbyID("<%=txt3.ClientID%>").value =
这篇关于在javascript中设置的值无法在服务器端读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!