Jquery chosen select默认值为之前选择input值
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Jquery chosen select默认值为之前选择input值相关的知识,希望对你有一定的参考价值。
function:
if(!ace.vars['touch'])
$('.chosen-select').chosen(
allow_single_deselect:true,
search_contains:true
);
$(window)
.off('resize.chosen')
.on('resize.chosen', function()
$('.chosen-select').each(function()
var $this = $(this);
$this.next().css('width': $this.parent().width());
);
).trigger('resize.chosen');
$(document).on('settings.ace.chosen', function(e, event_name, event_val)
if(event_name != 'sidebar_collapsed') return;
$('.chosen-select').each(function()
var $this = $(this);
$this.next().css('width': $this.parent().width());
);
);
$('#chosen-multiple-style .btn').on('click', function(e)
var target = $(this).find('input[type=radio]');
var which = parseInt(target.val());
if(which == 2) $('#form-field-select-4').addClass('tag-input-style');
else $('#form-field-select-4').removeClass('tag-input-style');
);
$(select).val($("#BANZU").val());
$(select).trigger("chosen:updated");
JSP:
<td id="xzsp" >
<select onchange="setGoogsName();" class="chosen-select form-control" name="SGOODS_ID" id="SGOODS_ID" data-placeholder="请选择物料" style="vertical-align:top;width:50px;" >
<option value="" selected="selected">
</option>
<c:forEach items="$classnamList" var="var">
<option value="$var.CLASSNAM_ID"
<c:if test="$var.CLASSNAM_ID == CLASSNAM_ID">selected</c:if>>$var.CLASSNAME9
</option>
</c:forEach>
<input type="text" name="BANZU" id="BANZU" value="$pd.BANZU" maxlength="255" placeholder="输入班组" title="班组" style="width:50;display:none" />
</select>
</td>
如何让select的 默认值 为之前选择的input值
<input type="text" name="BANZU" id="BANZU" value="$pd.BANZU" maxlength="255" placeholder="输入班组" title="班组" style="width:50;display:none" onchange="document.getElementById('SGOODS_ID').value=this.value"/> 参考技术B 🐵🙉🙊🙊🙊🙊🐟🙉🐵🐵🙈🙉🙊🙊🙊🐒🐳🐬🙉🙉🙊🙊🐒🐒🐒
以上是关于Jquery chosen select默认值为之前选择input值的主要内容,如果未能解决你的问题,请参考以下文章