一个关于HTML或者ASP或者SCRIPT的简单问题,大家帮助啊!(100分)

  • 主题发起人 主题发起人 张剑波
  • 开始时间 开始时间

张剑波

Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
<html>
<head>
<title>New Page 1</title>
</head>
<body>
<form action="123.exe" method=post>

<input type=checkbox name=水果1>桃子<p>
<input type=checkbox name=水果2>西瓜<p>
<input type=checkbox name=水果3>大枣<p>
<input type=submit><input type=reset>
</form>
</body>
</html>
——————————————————————————
简单吧!
我的问题是这样的:
当用户按下submit时(或者你另加的其他按钮),不通过后台服务器(“123.exe")
,就在客户网页上立即显示出你选择了些什么?


 
submit onclick=javascript:function abc();

function abc()
{
}

对象名都忘了,
大概就是这样实现的
 
有这个必要吗???
 
<html>
<head>
<title>New Page 1</title>
</head>
<body>
<script>
function show()
{
if(document.theform.水果1.checked)
alert(document.theform.水果1.name)
if(document.theform.水果2.checked)
alert(document.theform.水果1.name)
if(document.theform.水果2.checked)
alert(document.theform.水果1.name)
}
</script>
<form action="123.exe" method=post name=theform>

<input type=checkbox name=水果1>桃子<p>
<input type=checkbox name=水果2>西瓜<p>
<input type=checkbox name=水果3>大枣<p>
<input type=submit><input type=reset><input type="button" value="按钮" name="B1" onclick="show()">
</form>
</body>
</html>


没有优化过。 :)
建议这样写就能显示具体的内容了
<input type=checkbox name=水果1 value="桃子">桃子<p>
然后改成
alert(document.theform.水果1.value)
 
楼上就行
 
多人接受答案了。
 
后退
顶部