写的第一个东东.本来是个JSP文件的 .不过没有关系.真接改护展名为HTMl的也可以看到本方要说的效果了
代码很简单相信大家都能看懂.刚学JAvascritT时写的. 还有一点收藏.以后慢慢发吧 今天很晚了!
<script language="javascript">
function checkForm1()
{
if(document.Form1.Fname.value=="")
{
document.Form1.Fname.focus();
alert("请输入查询条件");
return false;
}
return true;
}
function selectall(v)
{
//全选
var f=document.form2;
var i=0;
for (i=0;i<f.elements.length;i++)
{
if(v.value=="1" && f.elements[i].name=="Sub") f.elements[i].checked=false;
if(v.value=="0" && f.elements[i].name=="Sub") f.elements[i].checked=true;
}
if (v.value=="1")
v.value="0"
else
v.value="1"
}
function select_reverse()
{
//反选
var f=document.form2;
var i=0;
for (i=0;i<f.elements.length;i++)
{
if(f.elements[i].name=="Sub")
f.elements[i].checked= f.elements[i].checked==false?true:false;
}
}
</script>
<body>
<table width="800" border="1" align="center" cellpadding="1" cellspacing="1">
<form name="Form1"action="#" οnsubmit="return checkForm1()" method="post">
<tr>
<td width="89">查询条件:</td>
<td width="50">ID:
<label></label></td>
<td width="569"><input name="fid_min" type="text" id="fid_min" />
到
<input name="Fid_max" type="text" id="Fid_max" /></td>
<td width="79"> </td>
</tr>
<tr>
<td> </td>
<td>姓名:
<label></label></td>
<td><input name="Fname" type="text" id="Fname" /></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><label>
<input type="submit" name="Submit3" value="开始查询 " />
</label></td>
<td> </td>
</tr>
</form>
</table>
<table width="800" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#F6F6F6">
<form name="form2">
<tr>
<td width="94" align="center">选 中 </td>
<td width="237" align="center">姓 名</td>
<td width="377" align="center">备注</td>
<td width="77"> </td>
</tr>
<tr>
<td><label>
<input name="Sub" type="checkbox" id="Sub" value="checkbox" />
1</label></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><label>
<input name="Sub" type="checkbox" id="Sub" value="checkbox" />
2</label></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><input type="checkbox" name="checkbox22" value="checkbox" />
3</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><label>
<input type="checkbox" name="checkbox" οnclick="selectall(this)" value="0" />
全选<br />
<input type="radio" name="radiobutton1" value="radiobutton" οnclick="select_reverse()" />
反选
<br />
</label></td>
<td><label>
<input type="submit" name="Submit" value="删 除" />
<input type="submit" name="Submit2" value="隐 藏" />
</label></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><label></label>
<label></label></td>
<td><label>
<input name="priview" type="submit" id="priview" value="上一页 " />
<input name="next" type="submit" id="next" value="下一页" />
跳到第
<select name="select">
</select>
页</label></td>
<td><label>
<input type="submit" name="Submit6" value="每页显示" />
</label>
<label>
<input name="textfield4" type="text" size="3" maxlength="3" />
条记录</label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</form>
</table>
</body>
</html>