+ -
当前位置:首页 → 问答吧 → 求救

求救

时间:2011-11-18

来源:互联网

我想做一个这样的页面,打开以后自动载入某个网页,网页中有很多复选框,打开的时候自动选中我指定的几个复选框,请问该怎么做,请说的详细点,有源码最好,万分感谢

作者: newqq   发布时间: 2011-11-18

HTML code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
<input id="Checkbox1" type="checkbox" checked="checked"/>
<input id="Checkbox2" type="checkbox" />
<input id="Checkbox3" type="checkbox" />
<input id="Checkbox4" type="checkbox" checked="checked"/>
<input id="Checkbox5" type="checkbox" />
<input id="Checkbox6" type="checkbox" />
</body>
</html>


要哪个被选中就指定其checked="checked"。。你也可以用JS。jquery去实现

作者: zsx841021   发布时间: 2011-11-18

谢谢你,我的意思是选中别人网页上的复选按钮

作者: newqq   发布时间: 2011-11-18

比如,我想打开这个网站之后自动选择几个指点的复选框:http://www.dbjszgztp.com/prjvote/index.jsp

作者: newqq   发布时间: 2011-11-18

a.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
</head>
<body>
<iframe src="b.html"></iframe>
</body>
</html>

b.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
</head>
<body>
<input id="Checkbox1" type="checkbox" checked="checked"/>
<input id="Checkbox2" type="checkbox" />
<input id="Checkbox3" type="checkbox" />
<input id="Checkbox4" type="checkbox" checked="checked"/>
<input id="Checkbox5" type="checkbox" />
<input id="Checkbox6" type="checkbox" />
</body>
</html>
如果对数据库查询那你就判断某一字段循环 如:
<%
do while not rs.eof then
if rs("sign")=1 then
 response.write "<input id='Checkbox1' type='checkbox' checked='checked'/>"
else
 response.write "<input id='Checkbox1' type='checkbox'/>"
end if
rs.movenext
loop
%>



作者: hefeng_aspnet   发布时间: 2011-11-18

可能是我没说清楚,就以上面的a和b页面来说,b页面的复选框初始状态是没有被选中的,我现在想要在a页面自动加载B页面,并自动是B页面的复选框选中

作者: newqq   发布时间: 2011-11-18