导航:首页 > 万维百科 > 网页设计代码复选框

网页设计代码复选框

发布时间:2020-08-27 20:32:29

1、ASP怎么用代码来勾选复选框

首先你提问不科学,ASP代码运行结果是html代码,不存在说用asp为勾选筛选框,这个

勾选复选框就是用JS代码+HTML实现,给你以下例程代码,你就明白了:

<FORM METHOD="POST" ACTION="" name="myform">
<INPUT TYPE="checkbox" NAME="mybox" value="1" >复选框1 
<INPUT TYPE="checkbox" NAME="mybox" value="2" >复选框2
<INPUT TYPE="checkbox" NAME="mybox" value="3" >复选框3
   </FORM>

<INPUT TYPE="button" onclick="selectAll();" value="选中">

<script type="text/javascript">
function selectAll()

var objs = document.getElementsByName('mybox'); 
var i; 
for(i = 0; i < objs.length; i++) 

if(objs[i].type == "checkbox") 

objs[i].checked = true; 



</script>

2、制作网页时,保存多个复选框选中状态的代码

<input name="fuxuan1" type="checkbox" id="fuxuan12" value="a" />

<input name="fuxuan2" type="checkbox" id="fuxuan22" value="b" />

<input name="fuxuan3" type="checkbox" id="fuxuan32" value="c" />

<input name="fuxuan4" type="checkbox" id="fuxuan42" value="d" /></td>

<input name="fuxuan6" type="checkbox" id="fuxuan62" value="f" />

<input name="fuxuan7" type="checkbox" id="fuxuan72" value="g" />

选中那个就是那个值、、、、、

3、网页设计 如何插入复选框

如果是用Dreamweaver编辑网页的话,直接使用:插入--表单--复选框即可,
代码格式如下:
<form id="form1" name="form1" method="post" action="">
<input type="checkbox" name="button" id="button" />
<label for="button">第一个</label>
<input type="checkbox" name="button" id="button" />
<label for="button">第二个</label>
</form>

4、求网页设计中要全部去掉打勾选项的代码

1.复选框全选、全不选和反选的效果实现

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>复选框全选、全不选和反选的效果实现</title>
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function checkAll() {
for (var j = 1; j <= 9; j++) {
box = eval("document.checkboxform.C" + j);
if (box.checked == false) box.checked = true;
}
}

function uncheckAll() {
for (var j = 1; j <= 9; j++) {
box = eval("document.checkboxform.C" + j);
if (box.checked == true) box.checked = false;
}
}

function switchAll() {
for (var j = 1; j <= 9; j++) {
box = eval("document.checkboxform.C" + j);
box.checked = !box.checked;
}
}
// End -->
</script>
</head>

<body>

<form name=checkboxform>
<input type=checkbox name=C1 checked>C1<br>
<input type=checkbox name=C2 checked>C2<br>
<input type=checkbox name=C3 checked>C3<br>
<input type=checkbox name=C4 checked>C4<br>
<input type=checkbox name=C5 checked>C5<br>
<input type=checkbox name=C6 checked>C6<br>
<input type=checkbox name=C7 checked>C7<br>
<input type=checkbox name=C8 checked>C8<br>
<input type=checkbox name=C9 checked>C9<br>
<br>
<input type=button value="全部选中" onClick="checkAll()"><br>
<input type=button value="全部不选" onClick="uncheckAll()"><br>
<input type=button value="选择转换" onClick="switchAll()"><br>
</form>

</body>

</html>

2.本地打开网页邮箱,是不是设置提交的时候的地址不对,提示错误信息是什么?说明登录邮箱的公司,根据人家的邮箱登录的设置,你在进行设置即可。。方法可以看网上登录邮箱时候的源代码。

5、在html中如何设置复选框checkbox的大小?

checkbox那个框的样子是不会变大的,但触发区域可以通过你设置width height样式变大。对那个框样子不满意的话,可以将它透明度设为0,下面放一个样式中意的div,这样能够做到看上去是在点击那个div。

6、html新建一个网页,页面显示10*10共100个复选框 求代码

把下面的代码复制到一个html文件中用浏览器打开:

<div id="content"></div>
<script>
var str = '';
for(var i = 1; i <= 100 ; i++){
    if(i % 10 == 0){
        //这行代码后面加上换行标签br,下面的标签被百度吃了
        str += '<input type="checkbox" /><br/>';
    }else{
        str += '<input type="checkbox" />';
    }
}
document.getElementById('content').innerHTML = str;
</script>

7、跪求答案:网页设计中复选框问题

是的,要变大,只要有<input>空间的单元格都会变大,处理方法是用CSS设置单元格为固定大小,这个固定值比所有的格子都大。

8、网页制作中,做那种可多选的勾选框怎么做?

checkbox 啊

<input type="checkbox" name="hobby" value="wangqiu">网球</input>
<input type="checkbox" name="hobby" value="lanqiu">篮球</input>

都是提交到hobby 里面的 需要用 hobyy[0],hobby[1],取出

9、html复选框

多选一应该使用单选框呀,把你的<form>...</form>部分贴上来看看。

补充:
那你的意思是说,这个<form>里面的checkbox,至少要选中一个,否则就算空,因为不能要求所有都必须选择,是?

那样我认为,可以用循环检测所有的checkbox,如果有一个选中就设置变量has1为true,我写了下面的例子代码:

<form name='form1'>
<input type='checkbox' name='VoteOption1' value=1>通过本课程学习了解<br>
<input type='checkbox' name='VoteOption1' value=2>掌握具体的网络方法<br>
<input type='checkbox' name='VoteOption1' value=3>掌握一些基本原理与方法
</form>

<script type=text/javascript>
has1=false;
for (i=0;i<document.form1.length;i++)
if (document.form1.elements[i].type=='checkbox')
if (document.form1.elements[i].checked) has1=true;
if (has1==false) alert('一个都没有选');
</script>

10、html中怎么在单元格里做复选框?

不是option
这样写: <input type="checkbox" name="你自己定" value="1" /> 想要几个就做几个

与网页设计代码复选框相关的知识