很弱的问题

uptoyou 2004-07-12 10:18:38
怎么利用javascript实现提交后,将提交的内容显示出来

好像要用什么警告框之类的东西吧?

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<form name="form1" method="post" action="">
选项1:
<input type="text" name="textfield">
选项2:
<input type="text" name="textfield2">
选项3:
<input type="text" name="textfield3">
选项4:
<input type="text" name="textfield4">
选项5:
<input type="text" name="textfield5">
<input type="submit" name="Submit" value="提交">
</form>
</body>
</html>
...全文
164 13 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
uptoyou 2004-07-14
  • 打赏
  • 举报
回复
该怎么写啊?
uptoyou 2004-07-13
  • 打赏
  • 举报
回复
我想在弹出的confirm中如下显示,该怎么写?

是否要提交数据呢?
选项一:document.form1.textfield.value
选项二:document.form1.textfield2.value
选项三:document.form1.textfield3.value
选项四:document.form1.textfield4.value
选项五:document.form1.textfield5.value

  • 打赏
  • 举报
回复
设置变量把是否要提交跟document.form1.textfield.value加一下
uptoyou 2004-07-12
  • 打赏
  • 举报
回复
52juanjuan(Fibona) ( ) 信誉:100
你好,谢谢你

我就是想做你的这种,但是我这样做

if(!confirm("是否要提交数据呢? document.form1.textfield.value"))
{
//如果选择了否就中断你的操作,并返回
return false;
}

显示出来的是“是否要提交数据呢? document.form1.textfield.value”
没有数据,不知道该怎么修改
52juanjuan 2004-07-12
  • 打赏
  • 举报
回复
if(!confirm("是否要提交数据呢?"))
{
//如果选择了否就中断你的操作,并返回
return false;
}

//如果选择了是就继续你的操作
52juanjuan 2004-07-12
  • 打赏
  • 举报
回复
如果在本页面的话用alert就可以了,方法见上面的,如果提交到别的页面,直接输出各种元素的name的值所代表的变量的值就可以了.
uptoyou 2004-07-12
  • 打赏
  • 举报
回复
confirm怎么用啊?
woyingjie 2004-07-12
  • 打赏
  • 举报
回复
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script>
<!--
function killerj(){
killerj="选项一:"
killerj=killerj+document.form1.textfield.value
killerj=killerj+" 选项二"
killerj=killerj+document.form1.textfield2.value
killerj=killerj+" 选项三"
killerj=killerj+document.form1.textfield3.value
killerj=killerj+" 选项四"
killerj=killerj+document.form1.textfield4.value
killerj=killerj+" 选项五"
killerj=killerj+document.form1.textfield5.value

alert(killerj)
}
-->
</script>
</head>
<body>
<form name="form1" method="post" action="">
选项1:
<input type="text" name="textfield">
选项2:
<input type="text" name="textfield2">
选项3:
<input type="text" name="textfield3">
选项4:
<input type="text" name="textfield4">
选项5:
<input type="text" name="textfield5">
<input type="button" name="Submit" onclick="killerj()">
</form>
</body>
</html>
wwweasy 2004-07-12
  • 打赏
  • 举报
回复
上面说的是这个意思吧,把字符和变量加起来
wwweasy 2004-07-12
  • 打赏
  • 举报
回复
("是否要提交数据呢? "+document.form1.textfield.value)
xemail 2004-07-12
  • 打赏
  • 举报
回复
在论坛里搜一下吧
uptoyou 2004-07-12
  • 打赏
  • 举报
回复
up
uptoyou 2004-07-12
  • 打赏
  • 举报
回复
没有明白楼上的意思

麻烦说详细一些好吗?

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧