JSP Form form Method Sample _jsp programming

Source: Internet
Author: User
1. Code:
Copy Code code as follows:

<%--
Document:index
Created on:2009-10-4, 13:56:46
Author:lucifer
--%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<title></title>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<script type= "Text/javascript" >
function Givefocus () {
Document.login.user.focus ()
}
function SubmitForm () {
Document.login.submit ()
}
function Resetform () {
Document.login.reset ()
Document.login.user.focus ()
}
</script>
<body bgcolor= "#c0c0c0" link= "#999999" alink= "#999999" vlink= "#999999"
Onload= "Givefocus ()" >
<center>
<font size= "+2" >
<br><br>
<B>LOGIN</B>
</font>
<br><br><br><br>
<form name= "Login" method= "POST"
action= "http://wenda.tianya.cn/wenda/thread?tid=129583d1f709f89f" >
<table width= "50%" >
<tr>
&LT;TD align= "Right" >
<font size= "+1" >
<b>user id</b>
</font>
</td>
<td>
<font size= "+1" >
<input type= "text" name= "user" maxlength= "9" >
</font>
</td>
</tr>
<tr>
&LT;TD align= "Right" >
<font size= "+1" >
<B>Password</B>
</font>
</td>
<td>
<font size= "+1" >
<input type= "password" name= "password"
Maxlength= "8" >
</font>
</td>
</tr>
</table>
<br><br><br>
<font size= "+1" >
<B>
<input type= "button" value= "LOGIN" onclick= "SubmitForm ()" >

<input type= "button" value= "RESET" onclick= "Resetform ()" >
<br>
</B>
</font>
</form>
</center>
</body>

2. Conclusion:
"FormName". Submit () is the same as <input type= "Submit" ......>, that is, submitting form data, if button and submit exist at the same time, only submit has the role of submitting a form
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.