html如何做下拉的可多选的复选框列表

html如何做下拉的可多选的复选框列表,第1张

下面是我做的一个范例,你可以参考一下

<!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>

<meta http-equiv="Content-Type" content="text/htmlcharset=utf-8" />

<title>自定义表单1 - powered by dedecms</title>

<link href="img/nspage.css" rel="stylesheet" type="text/css" />

<script language="javascript" src="../include/dedeajax2.js"></script>

</head>

<body>

<div class="main mceneter">

<div class="toplogo">

<div class="logo">

<a href="/"><img src="/templets/default/images/logo.gif" /></a>

</div>

<div class="title">

<a href='diy.php?action=list&diyid=1'>自定义表单1</a> >发布信息

</div>

</div>

<div class="cmain">

<div class="ctitle">

<h1>自定义表单1发布</h1>

<span></span>

</div>

<div class="cbox mceneter">

<div class="maplist">

<br />

<form action="/plus/diy.php" enctype="multipart/form-data" method="post">

<input type="hidden" name="action" value="post" />

<input type="hidden" name="diyid" value="1" />

<input type="hidden" name="do" value="2" />

<table style="width:97%" cellpadding="0" cellspacing="1">

<tr>

<td align="right" valign="top">范例:</td>

<td><select name='fl' style='width:150px'><option value='男'>男</option>

<option value='女'>女</option>

<option value='人妖'>人妖</option>

</select>

</td>

</tr>

<input type="hidden" name="dede_fields" value="fl,select" />

<input type="hidden" name="dede_fieldshash" value="db5f139909450665fd4b641fff161416" /></table>

<div align='center' style='height:30pxpadding-top:10px'>

<input type="submit" name="submit" value="提 交" class='coolbg' />

<input type="reset" name="reset" value="重 置" class='coolbg' />

</div>

</form>

</div>

</div>

</div>

</div>

<div class="copyright mceneter">

Powered by <a href="http://www.dedecms.com" target="_blank">DedeCMS</a>© 2004-2009 <a href="http://www.desdev.cn" target="_blank">DesDev</a>Inc.

</div>

</body>

</html>

Js代码

<script type="text/javascript">

function judge()

{

var cbobj=document.getElementById("cb")

var divobj=document.getElementById("rb")

if(cbobj.checked)

{

divobj.style.display=""

}

else

{

divobj.style.display="none"

}

}

</script>

表单代码

<form action="" method="get">

<input name="cb" id="cb" type="checkbox" value="" onclick="judge()"/>

<div id="rb" style="display:none">

<input name="sex" type="radio" value="男" />

<input name="sex" type="radio" value="女" />

</div>

</form>

不知道是不是你要的效果

input元素的type属性值为()表示该按钮为复选框按钮。

maxlength

size

readonly(正确答案)

checked


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/7501958.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-06
下一篇 2023-04-06

发表评论

登录后才能评论

评论列表(0条)

保存