jsp页面中文本框,下拉框,单选框,复选框,文本域的清空jsp页面中文本框,下拉框,单选框,复选框,文本域的清空
[/align][align=center]
%@ page language= java import= java.util.* pageEncoding= utf-8 %
%
String path = request.getContextPath();
String basePath = request.getScheme()+ :// +request.getServerName()+ : +request.getServerPort()+path+ ...
jsp页面中文本框,下拉框,单选框,复选框,文本域的清空
[/align][align=center]
%@ page language= java import= java.util.* pageEncoding= utf-8 %
%
String path = request.getContextPath();
String basePath = request.getScheme()+ :// +request.getServerName()+ : +request.getServerPort()+path+ / ;
%
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
head
base href= %=basePath%
title 缓存技术的应用 /title
meta http-equiv= pragma content= no-cache
meta http-equiv= cache-control content= no-cache
meta http-equiv= expires content= 0
meta http-equiv= keywords content= keyword1,keyword2,keyword3
meta http-equiv= description content= This is my page
!--
link rel= stylesheet type= text/css href= styles.css
--
script type= text/javascript
//清空查询条件
function clearForm(){
document.getElementById('name').value= ;
document.getElementById('sex').value= ;
document.getElementById('textfield').value= ;
//清空单选和复选框
var checked = checked || false;
var objects = document.getElementsByTagName( input ); //拿到input的值
for(var i=0;i objects.length;i++){
if(objects[i].type=='radio' || objects[i].type=='checkbox'){ //判断类型
if(checked==true)
objects[i].checked= checked ;
else
objects[i].checked= ;
}
}
}
/script
/head
body
center
form action= name= fm method= post
table border= 1
tr
td colspan= 2 align= center 缓存的应用 /td
/tr
tr
td
姓名: /td
td
input name= name type= text value= /
/td
/tr
tr
td 性别: /td
td
select name= sex
option value= 请选择 /option
option value= 男 男 /option
option value= 女 女 /option
/select /td
/tr
tr
td
单位类型:
/td
td
nbsp; input type= radio value= 1 name= unittype / 管理部门
nbsp; input type= radio value= 2 name= unittype / 普通企业
/td
/tr
tr
td 常用语言: /td
td
nbsp;
input type= checkbox name= name2 java
input type= checkbox name= name2 php
input type= checkbox name= name2 c++ br
/td
/tr
tr
td
兴趣爱好:
/td
td
textarea name= textfield id= textfield /textarea
/td
/tr
tr
td align= center colspan= 2
input type= submit value= 提交 /
input type= button value= 重置 onclick= clearForm(); /
/td
/tr
/table
/form
/center
/body
/html
[/align][align=center] [align=left][/align]
本文档为【jsp页面中文本框,下拉框,单选框,复选框,文本域的清空】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。