点input框,弹出一个多选框,进行选择,每个以逗号隔开,如上图所示
1. <input id="taskPlanDay" name="taskPlanDay" type="text" style="width: 150px" class="inputxt" readonly="readonly"
datatype="*"
>
2.js片段
<script language="javascript">
$('#taskPlanDay').bind('focus', function() {
var offset = $(this).offset(), container = $('div.container');
container.css({top:offset.top+Number($(this).css('height').replace('px', '')), left:offset.left}).show(100);
});
$(document).bind('click', function(){
var targ;
if (event.target) targ = event.target
else if (event.srcElement) targ = event.srcElement
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
if (targ.id !='taskPlanDay' && !$(targ).parents('div.container').attr('class'))
$('div.container').hide(100);
});
$('#submit').bind('click', function(){
var vals = '', length;
$('div.frame input[type=checkbox]:checked').each(function(){
vals += ($(this).next().text() + ',');
});
if ((length = vals.length) &