
js弹出窗口提交时显示刚刚填写的信息
做了一个个人信息提交的网页,要求在所有信息都提交之后弹出一个对话框,将刚刚填写过的信息都重新在弹出的对话框里显示一遍,请问怎么做,最好详细一些,初学。...
做了一个个人信息提交的网页,要求在所有信息都提交之后弹出一个对话框,将刚刚填写过的信息都重新在弹出的对话框里显示一遍,请问怎么做,最好详细一些,初学。
展开
展开全部
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<script>
function submitForm1()
{
var str="";
str+="姓名:"+document.getElementById('txtName').value+"\n";
str+="年龄:"+document.getElementById('txtAge').value+"\n";
str+="性别:"+document.getElementById('txtSex').value;
alert(str);
form1.submit();
}
</script>
<body>
<form action="b.html" id="form1">
<table>
<tr>
<td>姓名:</td>
<td>年龄:</td>
<td>性别:</td>
</tr>
<tr>
<td><input type="text" id="txtName" /></td>
<td><input type="text" id="txtAge" /></td>
<td><input type="text" id="txtSex" /></td>
</tr>
<tr>
<td colspan=3><input type="button" id="btnSubmit" value="提交" onclick="submitForm1()"/></td>
</tr>
</table>
</form>
</body>
</html>
希望你能明白~
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<script>
function submitForm1()
{
var str="";
str+="姓名:"+document.getElementById('txtName').value+"\n";
str+="年龄:"+document.getElementById('txtAge').value+"\n";
str+="性别:"+document.getElementById('txtSex').value;
alert(str);
form1.submit();
}
</script>
<body>
<form action="b.html" id="form1">
<table>
<tr>
<td>姓名:</td>
<td>年龄:</td>
<td>性别:</td>
</tr>
<tr>
<td><input type="text" id="txtName" /></td>
<td><input type="text" id="txtAge" /></td>
<td><input type="text" id="txtSex" /></td>
</tr>
<tr>
<td colspan=3><input type="button" id="btnSubmit" value="提交" onclick="submitForm1()"/></td>
</tr>
</table>
</form>
</body>
</html>
希望你能明白~
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你写一个JS函数
在提交按纽那里使用他的 onclick事件关联那个函数
函数体里面
通过document.getElementById('xxx').value 得到你表单里的所有元素的值。。
然后通过
alert()打印出来就是了
在提交按纽那里使用他的 onclick事件关联那个函数
函数体里面
通过document.getElementById('xxx').value 得到你表单里的所有元素的值。。
然后通过
alert()打印出来就是了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
页面中的button或submit标签
添加一个onclick
例如<input type="button" id="button" name="button" onclick="check()">
在页面中<head></head>内加如
<script language="javascript">
function check()
{
var name = document.userForm.name.value;
alert("name");
}
</script>
添加一个onclick
例如<input type="button" id="button" name="button" onclick="check()">
在页面中<head></head>内加如
<script language="javascript">
function check()
{
var name = document.userForm.name.value;
alert("name");
}
</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<script type="text/javascript">
function showMessage()
{
var txtName=document.getElementById("txtName").value;
alert("您输入的名字:"+txtName)
}
</script>
</HEAD>
<BODY>
<input name="txtName"/>
<input type="button" vlaue="提交" onclick="showMessage()"/>
</BODY>
function showMessage()
{
var txtName=document.getElementById("txtName").value;
alert("您输入的名字:"+txtName)
}
</script>
</HEAD>
<BODY>
<input name="txtName"/>
<input type="button" vlaue="提交" onclick="showMessage()"/>
</BODY>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
alert(document.getElementById('textname').value);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询