初学PHP,菜鸟一个,记录下学习过程遇到的问题..
点击按钮事件处理办法
一个form表单里两个按钮,一个处理form中的action事件,另一个则处理另珍上php事件
1.事例代码:
<html>
<head>
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
<script type=
"text/javascript"
>
function
aaa()
{
document.form.action=
"page2.php"
;
}
</script>
</head>
<body>
<form name=
"form"
method=
"post"
action=
"page1.php"
>
<input type=
"text"
name=
"name"
/>
<input type=
"submit"
name=
"check"
value=
"验证码"
onclick==
"aaa()"
/>
<input type=
"submit"
name=
"submit"
value=
"注册"
/>
</form>
</body>
</html>
2.事例代码
<html>
<head>
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
</head>
<body>
<form name=
"form"
method=
"post"
action=
"page1.php"
>
<input type=
"text"
name=
"name"
/>
<input type=
"submit"
name=
"check"
value=
"验证码"
onclick=
"javascript:this.form.action='page2.php';this.form.submit();"
/>
<input type=
"submit"
name=
"submit"
value=
"注册"
/>
</form>
</body>
</html>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。