用js给textbox赋值 为什么闪一下就没了呢? 你的button的type="submit"还是type="button" ? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 代码太少,无法解释!不过这样可以,L@_@K <body> <form id="form1"> <input type="text" id="TextBox1" /> </form> <script type="text/javascript"><!--var values = "1,2";var hdnObj = document.forms(0).TextBox1;hdnObj.value = values;//--></script> </body> .net前台代码:<body MS_POSITIONING="GridLayout"><form id="Form1" method="post" runat="server"><INPUT id="TextBox1" type="text"><asp:button id="Button1" runat="server" Text="Button"></asp:button></form><script language="javascript"> function FindCheckBox(){var values = "1,2";var hdnObj = document.Form1.TextBox1;hdnObj.value = values;}</script></body>该代码生成的源代码:<body MS_POSITIONING="GridLayout"><form name="Form1" method="post" action="WebForm1.aspx" id="Form1"><INPUT id="TextBox1" type="text"><input type="submit" name="Button1" value="Button" id="Button1" onclick="FindCheckBox()" /> </form><script language="javascript"> function FindCheckBox(){var values = "1,2";//选中CheckBox的值组合var hdnObj = document.Form1.TextBox1;hdnObj.value = values;}</script></body> //你的button的type="submit"还是type="button" ?<input type="submit" name="Button1" value="Button" id="Button1" onclick="FindCheckBox()" />----------》<input type="button" name="Button1" value="Button" id="Button1" onclick="FindCheckBox()" /> [size=16px][b]两口矿井年[/size][/b] 如何获取div中内容的高度 JQUERY可以实现组态软件的一些功能吗?! 能不能用javasript代码使当前浏览器窗口最大化?或者改变窗口尺寸?谢谢 动态表单验证!!! 如何使列表框里的滚动条在刷新或操作后位置保持不变 动态select问题 微软的 TreeView 控件,展开一个节点时总是出现 'event'为空或不是对象 错误 如何传递数据? html中<img>如何显示一个 后缀名不匹配的图片? 求助大神,无法访问此网站 localhost 拒绝了我们的连接请求 JavaScrip高手过来帮忙看看! 关于javascipt Base64加密用 Vbscript解密
<form id="form1">
<input type="text" id="TextBox1" />
</form>
<script type="text/javascript">
<!--
var values = "1,2";
var hdnObj = document.forms(0).TextBox1;
hdnObj.value = values;
//-->
</script>
</body>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<INPUT id="TextBox1" type="text">
<asp:button id="Button1" runat="server" Text="Button"></asp:button>
</form>
<script language="javascript">
function FindCheckBox()
{
var values = "1,2";
var hdnObj = document.Form1.TextBox1;
hdnObj.value = values;
}
</script>
</body>该代码生成的源代码:<body MS_POSITIONING="GridLayout">
<form name="Form1" method="post" action="WebForm1.aspx" id="Form1">
<INPUT id="TextBox1" type="text">
<input type="submit" name="Button1" value="Button" id="Button1" onclick="FindCheckBox()" />
</form>
<script language="javascript">
function FindCheckBox()
{
var values = "1,2";//选中CheckBox的值组合
var hdnObj = document.Form1.TextBox1;
hdnObj.value = values;
}
</script>
</body>
----------》
<input type="button" name="Button1" value="Button" id="Button1" onclick="FindCheckBox()" />