<!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>
<html><body>
<table border="1">
<tr>
<td><input type="radio" value="单选框">单选框</td>
<td><input type="checkbox" value="复选框">复选框</td>
</tr>
<td><input type="text" value="文本框"></td>
<td>
<select>
<option>下拉框</option>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</td>
<tr>
</tr>
</table>
</body>
</html>
你好,html自带的select元素,是不支持option中带checkbox的,所有如果想实现这样的特殊select,必须自己编写一个功能类似select的下拉框
我实现了一个简单的,你看下就会了,我用的箭头代表的三角,可以直接运行
<html>
<head>
<style>
ul{list-style-type:none}
li{border:solid 1pxwidth:100px}
.liShow{display:blockbackground:while}
.liHide{display:nonebackground:blue}
</style>
<script>
var nextState=1
function change(obj){
var liArray=document.getElementsByTagName("LI")
var i=1
var length=liArray.length
switch(nextState){
case 1:
obj.innerHTML="当前选择↑"
for(i<lengthi++){
liArray[i].className="liShow"
}
nextState=0
break
case 0:
obj.innerHTML="当前选择↓"
for(i<lengthi++){
liArray[i].className="liHide"
}
nextState=1
}
}
</script>
</head>
<body>
<ul id="myUl">
<li class="liMenu" onclick="change(this)">当前选择↓</li>
<li value="1" class="liHide"><input type="checkbox">1</li>
<li value="1" class="liHide"><input type="checkbox">2</li>
</ul>
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)