怎么用超链接提交表单的值?
例如这样的一个例子:<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/...
例如这样的一个例子:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<script LANGUAGE = " JavaScript " >
function checkvalue()
{
document.form1.action="addinone.htm";
document.from1.submit();
return ( true );
} </script>
<form name="form1" method="post" action="">
<table width="200" border="1">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<a href="#" onClick="javascript:checkvalue();return false:">sd</a>
</body>
</html>
哪里错了,点超链接怎么没反应?
我用的二楼方法成功了,不过当我把alert弹出框语句去掉时,点超链接后地址显示“#” 展开
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<script LANGUAGE = " JavaScript " >
function checkvalue()
{
document.form1.action="addinone.htm";
document.from1.submit();
return ( true );
} </script>
<form name="form1" method="post" action="">
<table width="200" border="1">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<a href="#" onClick="javascript:checkvalue();return false:">sd</a>
</body>
</html>
哪里错了,点超链接怎么没反应?
我用的二楼方法成功了,不过当我把alert弹出框语句去掉时,点超链接后地址显示“#” 展开
展开全部
展开全部
你的代码有问题,我给你改为正确的了:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<script LANGUAGE = "JavaScript" >
function checkvalue()
{
document.form1.action="addinone.htm";
document.form1.submit();
alert('已提交');
return true;
} </script>
<form name="form1" method="post" action="">
<table width="200" border="1">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<a href="#" onClick="javascript:return checkvalue();">sd</a>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<script LANGUAGE = "JavaScript" >
function checkvalue()
{
document.form1.action="addinone.htm";
document.form1.submit();
alert('已提交');
return true;
} </script>
<form name="form1" method="post" action="">
<table width="200" border="1">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<a href="#" onClick="javascript:return checkvalue();">sd</a>
</body>
</html>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐于2017-09-07 · 知道合伙人数码行家
关注
展开全部
用超链接提交表单值:
<a href='oneGetAllCultivateEndCertificateServlet?page=1&hiddenA=A'><font color='#000000'>首页</font></a>
<form name='form1' action='oneGetAllCultivateEndCertificateServlet' method='post'>
<input type='hidden' name='page' value='1'/>
<input type='hidden' name='hiddenA' value='A'/>
<a href='javascript:document.form1.submit();'><font color='#000000'>首页</font></a>
</form>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<script LANGUAGE = " JavaScript " >
function checkvalue()
{
document.form1.action="addinone.htm";
document.from1.submit(); //form1 写错了
return ( true );
} </script>
function checkvalue()
{
document.form1.action="addinone.htm";
document.from1.submit(); //form1 写错了
return ( true );
} </script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询