如何用javaScript实现form的submit功能
1个回答
展开全部
你好,给你段代码,参考一下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<html><head>
<script language="javascript" type="text/javascript">
function FormSubmit()
{
myFrm.action = "a.asp"
myFrm.submit();
}
</script>
</head>
<body>
<form name="myFrm">
表单项1:<input type="text" name="tt1">
表单项2:<input type="text" name="tt2">
</form>
<img alt="提交" src="b.gif" width="50" height="22" style="cursor:hand;" onclick="FormSubmit();">
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<html><head>
<script language="javascript" type="text/javascript">
function FormSubmit()
{
myFrm.action = "a.asp"
myFrm.submit();
}
</script>
</head>
<body>
<form name="myFrm">
表单项1:<input type="text" name="tt1">
表单项2:<input type="text" name="tt2">
</form>
<img alt="提交" src="b.gif" width="50" height="22" style="cursor:hand;" onclick="FormSubmit();">
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询