jsp form表單方法示例
更新時(shí)間:2009年10月04日 15:37:14 作者:
jsp form表單方法示例代碼,大家可以看下,對(duì)于新手來說是必備的知識(shí)。
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同時(shí)存在,只有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同時(shí)存在,只有submit有提交表單的作用
您可能感興趣的文章:
- 基于JS實(shí)現(xiàn)密碼框(password)中顯示文字提示功能代碼
- js實(shí)現(xiàn)input密碼框提示信息的方法(附html5實(shí)現(xiàn)方法)
- JavaScript實(shí)現(xiàn)輸入框(密碼框)出現(xiàn)提示語
- JavaScript如何實(shí)現(xiàn)在文本框(密碼框)輸入提示語
- JS實(shí)現(xiàn)密碼框根據(jù)焦點(diǎn)的獲取與失去控制文字的消失與顯示效果
- javascript 密碼框防止用戶粘貼和復(fù)制的實(shí)現(xiàn)代碼
- js正則實(shí)現(xiàn)的密碼框簡(jiǎn)單制作,還可以替換成自己想用得符號(hào)
- js獲取form的方法
- JS中的form.submit()不能提交表單的錯(cuò)誤原因
- form表單action提交的js部分與html部分
- JS實(shí)現(xiàn)密碼框的顯示密碼和隱藏密碼功能示例
相關(guān)文章
weblogic 8.1下重新編譯java類但不用重啟服務(wù)器的方法
weblogic 8.1下重新編譯java類但不用重啟服務(wù)器的方法...2007-12-12JSP動(dòng)態(tài)實(shí)現(xiàn)web網(wǎng)頁登陸和注冊(cè)功能
這篇文章主要介紹是動(dòng)態(tài)實(shí)現(xiàn)web網(wǎng)頁登陸和注冊(cè)功能的示例代碼,文中代碼講解詳細(xì),對(duì)我們學(xué)習(xí)JSP有一定的幫助,感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下2021-12-12JSP 動(dòng)態(tài)樹的實(shí)現(xiàn)
在實(shí)際的項(xiàng)目開發(fā)中有很多是有用到動(dòng)態(tài)樹,所謂的動(dòng)態(tài)樹就是可以支持無限級(jí)子節(jié)點(diǎn)。今天我就去給大家實(shí)際演示一下動(dòng)態(tài)樹如何實(shí)現(xiàn)。2009-04-04java易懂易用的MD5加密(可直接運(yùn)行) (1)
出于安全考慮,網(wǎng)絡(luò)的傳輸中經(jīng)常對(duì)傳輸數(shù)據(jù)做加密和編碼處理,其中涉及以下幾種2008-11-11JSP中常用的JSTL fmt(format格式化)標(biāo)簽用法整理
這篇文章主要介紹了JSP中常用的JSTL fmt(format格式化)標(biāo)簽用法整理,fmt的格式化處理遵循i18n國(guó)際化格式標(biāo)準(zhǔn),需要的朋友可以參考下2016-04-04