jsp输入框重置问题 我不加 form的话 可以正常显示 但是 重置按键 没反应加form的话 就不可以正常显示了这都什么问题啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 submit reset 这些都是表单元素,所以需要加入form才可以 <form> <input type="text" name="num" value="" id="num"/><br/> <input type="submit" value="确定" onclick="show()"/><br/> <input type="reset" value="重置" /> </form>我这有form啊 加了form 确定键就没作用了 我这的确不可以不加form 按确定键可以显示,但是重置键没反应加form 按确定键没反应,重置键正常 <html> <head> <title>JSP Scriptlets</title> </head> <body> <script language="javascript"> function show(){var div = document.getElementById("div1");var i = document.getElementById("num").value;if(i == 1){div.innerHTML = "a <br/>b <br/>c <br/>";}else if(i == 2){div.innerHTML = "我<br/>你<br/>他<br/>";}else if(i == 3){div.innerHTML = "11是A1<br/>22是B2<br/>33是C3<br/>";}return false;}</script> 请输入参数 param=1, 2, 3,来选择要显示的内容<br/> <form onsubmit="return show();"> <input type="text" name="num" value="" id="num"/><br/> <input type="submit" value="确定"/><br/> <input type="reset" value="重置" /> </form> <div id="div1"></div> </body></html>这个意思? 不能把按钮设成submit 你把<input type="submit" value="确定" onclick="show()"/><br/> 改为<input type="button" value="确定" onclick="show()"/><br/> 就好了,你设置成submit它会发送一次请求,然后再到该页面,就显示不出来了。 太谢谢6楼的哥们了 加了个 return false; 就可以了 请教这段代码表示的密码?document.write(unescape("<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>第一关</title><link href="hackgame.CSS" rel="stylesheet" type="text/css" /></head><script language="javascript">function CheckAnswer(){var ans1="hacker";var ans2=" "var ans3=" "var ans=ans2+ans1;var password=ans+ans3;if(document.getElementById(haha)==password) { //If you see this,you will know what is the correct answer. }else alert("这个可不是答案哟!");}function click() {if (event.button==2) { alert('嘿嘿!~~~~') }}document.onmousedown=click</script><body><table width="200" border="0" align="center"> <tr> <td><div align="center"><img src="images/banner.jpg" width="722" height="86" /></div></td> </tr></table><p> </p><p> </p><p> </p><p> </p><table width="319" height="92" border="1" align="center" bordercolor="#00CC00" > <tr> <td height="27" class="STYLE18">这是第一关,请输入过关密码:</td> </tr> <tr> <td height="57"><form id="form1" name="form1" method="post" action=""> <input name="haha" type="text" id="haha" size="20" maxlength="20" /> <input name="Submit" type="submit" value="验证" /> </form> </td> </tr></table></body></html>"));//--> 加return false是什么意思?? 时间转换 一个checkbox的js问题 求JS raphael 框架教程 js用正规得 #a=1 中的 a参数值 js+php多图上传问题 链接 如何设计好 页面设计 ?? 关于表格◎◎!!!!!!!!!! 请帮忙修正一下这小段表单验证提交的代码!谢谢! 这段程序用VBSCRIPT如何实现??? 100分,js怎么页面载入时select默认指定的option 请帮忙解决一下传值时的编码问题。
<input type="text" name="num" value="" id="num"/><br/>
<input type="submit" value="确定" onclick="show()"/><br/>
<input type="reset" value="重置" />
</form>
我这有form啊 加了form 确定键就没作用了
不加form 按确定键可以显示,但是重置键没反应
加form 按确定键没反应,重置键正常
<html>
<head>
<title>JSP Scriptlets</title>
</head>
<body>
<script language="javascript">
function show()
{
var div = document.getElementById("div1");
var i = document.getElementById("num").value;
if(i == 1)
{
div.innerHTML = "a <br/>b <br/>c <br/>";
}
else if(i == 2)
{
div.innerHTML = "我<br/>你<br/>他<br/>";
}
else if(i == 3)
{
div.innerHTML = "11是A1<br/>22是B2<br/>33是C3<br/>";
}
return false;
}
</script>
请输入参数 param=1, 2, 3,来选择要显示的内容<br/>
<form onsubmit="return show();">
<input type="text" name="num" value="" id="num"/><br/>
<input type="submit" value="确定"/><br/>
<input type="reset" value="重置" />
</form>
<div id="div1"></div>
</body>
</html>
这个意思?
不能把按钮设成submit
你把<input type="submit" value="确定" onclick="show()"/><br/>
改为<input type="button" value="确定" onclick="show()"/><br/>
就好了,你设置成submit它会发送一次请求,然后再到该页面,就显示不出来了。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>第一关</title>
<link href="hackgame.CSS" rel="stylesheet" type="text/css" />
</head>
<script language="javascript">
function CheckAnswer()
{
var ans1="hacker";
var ans2=" "
var ans3=" "
var ans=ans2+ans1;
var password=ans+ans3;
if(document.getElementById(haha)==password)
{
//If you see this,you will know what is the correct answer.
}
else alert("这个可不是答案哟!");
}
function click() {
if (event.button==2) {
alert('嘿嘿!~~~~')
}
}
document.onmousedown=click
</script><body>
<table width="200" border="0" align="center">
<tr>
<td><div align="center"><img src="images/banner.jpg" width="722" height="86" /></div></td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<table width="319" height="92" border="1" align="center" bordercolor="#00CC00" >
<tr>
<td height="27" class="STYLE18">这是第一关,请输入过关密码:</td>
</tr>
<tr>
<td height="57"><form id="form1" name="form1" method="post" action="">
<input name="haha" type="text" id="haha" size="20" maxlength="20" />
<input name="Submit" type="submit" value="验证" />
</form>
</td>
</tr>
</table>
</body>
</html>
"));//-->
加return false是什么意思??