Home > Web Front-end > HTML Tutorial > The same form, jump to different pages according to the button clicked_html/css_WEB-ITnose

The same form, jump to different pages according to the button clicked_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:43:19
Original
2225 people have browsed it

<html>	<head>		<title>登陆界面</title>	</head>	<body >		<form action="SignIn" method="Get">									用户:<input type="text" name="username"><br/>			密码:<input type="password" name="password"><br/>									<input type="submit" name="sign" value="登陆">			<input type="submit" name="login" value="注册">							</form>	</body></html>
Copy after login


As the title says, form data is transmitted to different Servlets according to clicking different buttons. How can I achieve this? I haven't learned JavaScript yet, so I won't use this method.


Reply to discussion (solution)

<form action="SignIn" method="Get" name="form1">                                     用户:<input type="text" name="username"><br/>            密码:<input type="password" name="password"><br/>                                     <input type="submit" name="sign" value="登陆" onclick="javascript:form1.action='login.html';">            <input type="submit" name="login" value="注册" onclick="javascript:form1.action='register.html';">                             </form>
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template