本帖最后由 sadfoo2019 于 2021-5-25 01:20 编辑
问题是这样的:我写了个js来实现,再网页上点“同意”,自动提取到上面的框里,需求是实现了的,可是我点了之后下面下拉框里还是“同意”2个字,如何js里修改把点了“同意”,下面不显示这两个字了直接空白。
这是效果预览
这是我的js脚本
[JavaScript] 纯文本查看 复制代码 jQuery(document).ready(function(){
var interval = setInterval(function(){
jQuery("select[title='部门分管院长选择']").change(function(){
jQuery("textarea[title='部门分管院长审批']").val(jQuery(this).val());
});
jQuery("select[title='信息分管院长选择']").change(function(){
jQuery("textarea[title='信息分管院长审批意见']").val(jQuery(this).val());
});
jQuery("select[title='院长审批选择']").change(function(){
jQuery("textarea[title='院长审批意见']").val(jQuery(this).val());
});
jQuery("input[title='设备名称']").change(function(){
var biaoti1= jQuery("input[title='设备名称']").val();
var biaoti2= jQuery("input[title='申请科室']").val();
jQuery("#Symbol",window.parent.document).val(biaoti1+"/"+biaoti2);
});
jQuery("input[name='DATA_92']").blur(function(){
var phone = jQuery("input[name='DATA_92']").val();
if(!isPhoneNo(phone)){
alert('输入的手机号码不正确')
jQuery("input[name='DATA_92']").val('');
}
});
clearInterval(interval);
},2000)
// 验证手机号
function isPhoneNo(phone){
// var pattern = /^1[34578]\d{9}$/;
var pattern = /^1[3|4|5|7|8][0-9]{9}$/;
return pattern.test(phone);
}
});
----------------------------------------------------------这是html
[HTML] 纯文本查看 复制代码 <tr style="height: 28px;">
<td height="28" align="center" valign="middle" style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext; text-align: center; -ms-word-break: break-all; background-color: transparent;">
<span style="font-family: 宋体; font-size: 16px;">资金编号 </span>
</td>
<td align="center" valign="middle" style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext black; text-align: center; -ms-word-break: break-all; background-color: transparent;" colspan="3">
<input name="DATA_110" title="资金编号" align="center" style="width: 292px; height: 26px; text-align: center; font-size: 14px;" value="" hidden="0"/>
</td>
<td width="79" align="center" valign="middle" style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext black; text-align: center; -ms-word-break: break-all; background-color: transparent;">
<span style="font-family: 宋体; font-size: 16px;">主管部门<span style="color: rgb(255, 0, 0); font-family: 宋体;"><span style="color: red; margin-left: 5px; vertical-align: middle;">*</span></span></span>
</td>
<td width="79" align="center" valign="middle" style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext black; text-align: center; -ms-word-break: break-all; background-color: transparent;">
<select name="DATA_135" title="主管部门" style="width: 110px;"><option selected="selected" value=""></option>
<option value="教务处">
教务处
</option>
<option value="科技外事处">
科技外事处
</option>
<option value="医务处">
医务处
</option>
<option value="组织人事处">
组织人事处
</option></select>
</td>
</tr>
<tr style="height: 28px;">
<td height="28" style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext; text-align: center; -ms-word-break: break-all; background-color: transparent;">
<span style="font-family: 宋体; font-size: 16px;">设备名称<span style="color: rgb(255, 0, 0); font-family: 宋体; font-size: 16px;"><span style="color: red; margin-left: 5px; vertical-align: middle;">*</span></span></span>
</td>
<td style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext black; text-align: center; -ms-word-break: break-all; background-color: transparent;" colspan="3">
<input name="DATA_113" title="设备名称" align="center" style="width: 292px; height: 26px; text-align: center; font-size: 14px;" value="" hidden="0"/>
</td>
<td width="79" style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext black; text-align: center; -ms-word-break: break-all; background-color: transparent;">
<span style="font-size: 16px;">申购数量<span style="color: rgb(255, 0, 0); font-family: 宋体;"><span style="color: red; margin-left: 5px; vertical-align: middle;">*</span></span></span>
</td>
<td width="79" style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext black; text-align: center; -ms-word-break: break-all; background-color: transparent;">
<input name="DATA_114" title="申购数量" align="center" style="width: 110px; height: 26px; text-align: center; font-size: 14px;" value="" hidden="0" validation="type:int;"/>
</td>
</tr>
<tr style="height: 28px;">
<td height="28" style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext; text-align: center; -ms-word-break: break-all; background-color: transparent;">
<span style="font-family: 宋体; font-size: 16px;">规格型号<span style="color: rgb(255, 0, 0); font-family: 宋体; font-size: 16px;"><span style="color: red; margin-left: 5px; vertical-align: middle;">*</span></span></span>
</td>
<td style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext black; text-align: center; -ms-word-break: break-all; background-color: transparent;" colspan="3">
<input name="DATA_115" title="规格型号" align="center" style="width: 292px; height: 26px; text-align: center; font-size: 14px;" value="" hidden="0"/>
</td>
<td width="79" style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext black; text-align: center; -ms-word-break: break-all; background-color: transparent;">
<span style="font-size: 16px;">预计金额 </span>
</td>
<td width="79" style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext black; text-align: center; background-color: transparent;">
<input name="DATA_97" title="预计金额" align="center" style="width: 110px; height: 26px; text-align: center; font-size: 14px;" value="" hidden="0" validation="type:float;"/>
</td>
</tr>
<tr>
<td style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext; text-align: center; background-color: transparent;">
<span style="font-family: 宋体; font-size: 16px;">用途说明<span style="color: rgb(255, 0, 0); font-family: 宋体; font-size: 16px;"><span style="color: red; margin-left: 5px; vertical-align: middle;">*</span></span></span>
</td>
<td style="border-width: 1px; border-style: solid; border-color: windowtext windowtext windowtext black; text-align: center; background-color: transparent;" colspan="5">
<div style="text-align: center;">
<textarea name="DATA_46" title="用途说明" style="width: 502px; height: 80px; font-size: 14px;" rich="1"></textarea>
</div>
</td>
</tr>
<tr height="29" style="height: 29px;">
<td height="29" style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext; text-align: center; background-color: transparent;">
<span style="font-family: 宋体; font-size: 16px;">附件</span>
</td>
<td style="border-width: 1px; border-style: solid; border-color: windowtext windowtext windowtext black; text-align: center; background-color: transparent;" colspan="5">
<img name="DATA_47" title="附件" align="absMiddle" class="FILEUPLOAD" style="border-width: 0px; cusor: pointer;" src="/static/images/form/fileupload.png" classname="FILEUPLOAD"/>
</td>
</tr>
<tr height="68" style="height: 68px;">
<td height="97" style="border-width: 1px; border-style: solid; border-color: black windowtext; text-align: center; background-color: transparent;">
<p style="text-align: center;">
<span style="font-family: 宋体; font-size: 16px;">主管部门</span>
</p>
<p style="text-align: center;">
<span style="font-family: 宋体; font-size: 16px;">预审</span>
</p>
</td>
<td style="border-width: 1px; border-style: solid; border-color: windowtext black black; text-align: right; background-color: transparent;" colspan="2">
<textarea name="DATA_50" title="主管部门预审意见" style="width: 200px; height: 65px; font-size: 14px;" rows="1" cols="1" rich="0"></textarea><input name="DATA_101" title="主管部门预审签字" class="AUTO" datafld="SYS_USERNAME_DATE" style="width: 130px; height: 24px; font-size: 14px;" type="text" value="{MACRO}" hidden="0"/>
</td>
<td style="border-width: 1px; border-style: solid; border-color: black windowtext; text-align: center; -ms-word-break: break-all; background-color: transparent;">
<p style="text-align: center;">
<span style="font-family: 宋体;"><span style="font-size: 16px;">信息中心</span></span>
</p>
<p style="text-align: center;">
<span style="font-family: 宋体;"><span style="font-size: 16px;">预审</span></span>
</p>
</td>
<td style="border-width: 1px; border-style: solid; border-color: windowtext black black; text-align: right; background-color: transparent;" colspan="2">
<textarea name="DATA_53" title="信息中心预审" style="width: 207px; height: 65px; font-size: 14px;" rows="1" cols="1" rich="0"></textarea><input name="DATA_102" title="信息中心签字" class="AUTO" datafld="SYS_USERNAME_DATE" style="width: 130px; height: 26px; font-size: 14px;" type="text" value="{MACRO}" hidden="0"/>
</td>
</tr>
<tr height="68" style="height: 68px;">
<td height="97" style="border-width: 1px; border-style: solid; border-color: black windowtext; text-align: center; background-color: transparent;">
<p style="text-align: center;">
<span style="font-family: 宋体; font-size: 16px;"><span style="font-family: 宋体; font-size: 16px;">主管部门</span></span>
</p>
<p style="text-align: center;">
<span style="font-family: 宋体; font-size: 16px;"><span style="font-family: 宋体; font-size: 16px;">审核</span></span>
</p>
</td>
<td style="border-width: 1px; border-style: solid; border-color: windowtext black black; text-align: right; background-color: transparent;" colspan="2">
<textarea name="DATA_52" title="主管部门审核意见" style="width: 200px; height: 65px; font-size: 14px;" rows="1" cols="1" rich="0"></textarea><input name="DATA_103" title="主管部门审核签字" class="AUTO" datafld="SYS_USERNAME_DATE" style="width: 130px; height: 24px; font-size: 14px;" type="text" value="{MACRO}" hidden="0"/>
</td>
<td style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext; text-align: center; -ms-word-break: break-all; background-color: transparent;">
<p style="text-align: center;">
<span style="font-family: 宋体;"><span style="font-size: 16px;">信息中心</span></span>
</p>
<p style="text-align: center;">
<span style="font-family: 宋体;"><span style="font-size: 16px;">审核<span style="font-family: 宋体; font-size: 16px;"></span></span></span>
</p>
</td>
<td style="border-width: 1px; border-style: solid; border-color: windowtext black; text-align: right; background-color: transparent;" colspan="2">
<textarea name="DATA_54" title="信息中心审核意见" style="width: 207px; height: 65px; font-size: 14px;" rows="1" cols="1" rich="0"></textarea><input name="DATA_105" title="信息中心审核" class="AUTO" datafld="SYS_USERNAME_DATE" style="width: 130px; height: 26px; font-size: 14px;" type="text" value="{MACRO}" hidden="0"/>
</td>
</tr>
<tr height="68" style="height: 68px;">
<td height="97" style="border-width: 1px; border-style: solid; border-color: black windowtext; text-align: center; background-color: transparent;">
<p style="text-align: center;">
<span style="font-family: 宋体; font-size: 16px;">部门分管</span>
</p>
<p style="text-align: center;">
<span style="font-family: 宋体; font-size: 16px;"> <span style="font-family: 宋体; font-size: 16px;">院长审批 </span></span>
</p>
</td>
<td style="border-width: 1px; border-style: solid; border-color: windowtext black black; text-align: right; background-color: transparent;" colspan="2">
<textarea name="DATA_122" title="部门分管院长审批" style="width: 200px; height: 65px; font-size: 14px;" rows="1" cols="1" rich="0"></textarea><select name="DATA_123" title="部门分管院长选择" style="width: 60px;"><option selected="selected" value=""></option>
<option value="同意">
同意
</option>
<option value="不同意">
不同意
</option></select> <input name="DATA_124" title="部门分管领导签字" class="AUTO" datafld="SYS_USERNAME_DATE" style="width: 130px; height: 24px; font-size: 14px;" type="text" value="{MACRO}" hidden="0"/>
</td>
<td style="border-width: 1px; border-style: solid; border-color: black windowtext windowtext; text-align: center; -ms-word-break: break-all; background-color: transparent;">
<p style="text-align: center;">
<span style="font-family: 宋体;"><span style="font-size: 16px;">信息分管</span></span>
</p>
<p style="text-align: center;">
<span style="font-family: 宋体;"><span style="font-size: 16px;">院长审批</span></span>
</p>
</td>
<td style="border-width: 1px; border-style: solid; border-color: windowtext black; text-align: right; background-color: transparent;" colspan="2">
<textarea name="DATA_125" title="信息分管院长审批意见" style="width: 207px; height: 65px; font-size: 14px;" rows="1" cols="1" rich="0"></textarea><select name="DATA_127" title="信息分管院长选择" style="width: 60px;"><option selected="selected" value=""></option>
<option value="同意">
同意
</option>
<option value="不同意">
不同意
</option></select> <input name="DATA_126" title="信息分管院长签字" class="AUTO" datafld="SYS_USERNAME_DATE" style="width: 130px; height: 24px; font-size: 14px;" type="text" value="{MACRO}" hidden="0"/>
</td>
</tr>
<tr height="68" style="height: 68px;">
<td height="97" style="border-width: 1px; border-style: solid; border-color: black windowtext; text-align: center; background-color: transparent;">
<p style="text-align: center;">
<span style="font-family: 宋体; font-size: 16px;"><span style="font-family: 宋体; font-size: 16px;"><span style="font-family: 宋体; font-size: 16px;">院长审批</span></span></span>
</p>
</td>
<td style="border-width: 1px; border-style: solid; border-color: windowtext black black; text-align: right; background-color: transparent;" colspan="5">
<p style="text-align: center;">
<textarea name="DATA_146" title="院长审批意见" style="width: 502px; height: 65px; font-size: 14px;" rows="1" cols="1" rich="0"></textarea>
</p>
<p>
<select name="DATA_147" title="院长审批选择" style="width: 60px;"><option selected="selected" value=""></option>
<option value="同意">
同意
</option>
<option value="不同意">
不同意
</option></select> <input name="DATA_148" title="院长签字" class="AUTO" datafld="SYS_USERNAME_DATE" style="width: 130px; height: 24px; font-size: 14px;" type="text" value="{MACRO}" hidden="0"/>
</p>
</td>
</tr>
解决办法源码
[JavaScript] 纯文本查看 复制代码 jQuery("select[title='部门分管院长选择']").change(function(){
// 定义获取选择的值
var val1 = jQuery("select[title='部门分管院长选择']").val();
// 把值获取到了提取到文本框里面
jQuery("textarea[title='部门分管院长审批']").val(val1);
// 把选择框清空
jQuery("select[title='部门分管院长选择']").val("");
});
|