如何新增一个珍藏勾选框,与原创的复选框功能相同,点击则到输入框种
<input name="oTitle" type="text" class="css_input" id="oTitle" value="<%=U.vTitle%>" size="60" <%if len(u.vtitle)=0 and lcl_titles=1 then%>onblur="ChkTitle('');"<%end if%><%if len(u.vtitle)=0 and lcl_titles=2 then%>onblur="ChkTitle($('oCid').value);"<%End If%> />
<label>
<input name="oCommend" type="checkbox" value="1" <%If U.vCommend = 1 Then Response.Write "checked='checked'"%> />原创
</label>
<script>
var checkBox = document.querySelector('input[name="oCommend"]');
var inputBox = document.querySelector('input[name="oTitle"]');
checkBox.addEventListener('change', function() {
if (this.checked) {
inputBox.value += '【原创】';
} else {
inputBox.value = inputBox.value.replace('【原创】', '');
}
});
</script>
<label><input name="oCommend" type="checkbox" value="1" <%If U.vCommend = 1 Then Response.Write "checked='checked'"%> /> 推荐</label>
<label><input name="oIsComment" type="checkbox" value="1" <%If U.vIsComment = 1 Then Response.Write "checked='checked'"%> /> 评论</label>
<label><input name="oDisplay" type="checkbox" value="1" <%If U.vDisplay = 1 Then Response.Write "checked='checked'"%> /> 发布</label>