jsp form表單方法示例
更新時間:2009年10月04日 15:37:14 作者:
jsp form表單方法示例代碼,大家可以看下,對于新手來說是必備的知識。
1.代碼:
<%--
Document : index
Created on : 2009-10-4, 13:56:46
Author : lucifer
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<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>
</head>
<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>
<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>
<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>
</html>
2.結(jié)論:
"formname".submit()作用與<input type="submit" ......>相同,就是提交表單數(shù)據(jù),如果button和submit同時存在,只有submit有提交表單的作用
復(fù)制代碼 代碼如下:
<%--
Document : index
Created on : 2009-10-4, 13:56:46
Author : lucifer
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<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>
</head>
<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>
<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>
<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>
</html>
2.結(jié)論:
"formname".submit()作用與<input type="submit" ......>相同,就是提交表單數(shù)據(jù),如果button和submit同時存在,只有submit有提交表單的作用
您可能感興趣的文章:
- 基于JS實現(xiàn)密碼框(password)中顯示文字提示功能代碼
- js實現(xiàn)input密碼框提示信息的方法(附html5實現(xiàn)方法)
- JavaScript實現(xiàn)輸入框(密碼框)出現(xiàn)提示語
- JavaScript如何實現(xiàn)在文本框(密碼框)輸入提示語
- JS實現(xiàn)密碼框根據(jù)焦點的獲取與失去控制文字的消失與顯示效果
- javascript 密碼框防止用戶粘貼和復(fù)制的實現(xiàn)代碼
- js正則實現(xiàn)的密碼框簡單制作,還可以替換成自己想用得符號
- js獲取form的方法
- JS中的form.submit()不能提交表單的錯誤原因
- form表單action提交的js部分與html部分
- JS實現(xiàn)密碼框的顯示密碼和隱藏密碼功能示例
相關(guān)文章
weblogic 8.1下重新編譯java類但不用重啟服務(wù)器的方法
weblogic 8.1下重新編譯java類但不用重啟服務(wù)器的方法...2007-12-12JSP動態(tài)實現(xiàn)web網(wǎng)頁登陸和注冊功能
這篇文章主要介紹是動態(tài)實現(xiàn)web網(wǎng)頁登陸和注冊功能的示例代碼,文中代碼講解詳細,對我們學(xué)習(xí)JSP有一定的幫助,感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下2021-12-12JSP中常用的JSTL fmt(format格式化)標簽用法整理
這篇文章主要介紹了JSP中常用的JSTL fmt(format格式化)標簽用法整理,fmt的格式化處理遵循i18n國際化格式標準,需要的朋友可以參考下2016-04-04