在规定时间内方有效的按钮(论坛中经常使用)

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

<!-- 把下列代码加到<body>区域中 -->

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function selectivecheck(field, myselection)

{

var fieldid;

var pos;

var criteria;

var strng;

strng = myselection.value;

for (i=0; i<field.length; i++)

{

if (strng=="all")

{

field[i

].checked = true;

}

else

{

fieldid = field[i

].id;

pos = strng.substring(0,1);

criteria = strng.substring(1,2); //this gets the information we want to evaluate

if (fieldid.substring(pos,pos+1)==criteria)

{

field[

i].checked = true;

}

else

{

field[

i].checked = false; //you could leave this out if you don't want to clear the check boxes

}

}

}

}

// End -->

</script>

<form>

<table align="center">

<tr><td>

<!--Load each ID with a string that will be parsed later -->

<input id=a1 type=checkbox name=list value="1">Group A SubGroup 1<br>

<input id=a2 type=checkbox name=list value="2">Group A SubGroup 2<br>

<input id=b1 type=checkbox name=list value="3">Group B SubGroup 1<br>

<input id=b2 type=checkbox name=list value="4">Group B SubGroup 2<br>

<input id=c1 type=checkbox name=list value="5">Group C SubGroup 1<br>

<input id=c2 type=checkbox name=list value="6">Group C SubGroup 2<br>

<!--Set your option values that contain a position and then the criteria-->

<p>

请你选择: <select size="1" name="mycombobox">

<option value="all">All Groups</option>

<option value="0a ">Group A</option>

<option value="0b ">Group B</option>

<option value="0c ">Group C</option>

<option value="11 ">SubGroup 1</option>

<option value="12 ">SubGroup 2</option>

</select>

<br>

<div align="center">

<input type="button" value="确定" onclick=" selectivecheck(this.form.list, this.form.mycombobox)">

</div>

</td></tr>

</table>

</form>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航