您好,登錄后才能下訂單哦!
初學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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。