• js点击select触发onchange函数


    点击select 中的不同option,生效日期框填入不同的日期:

    <table width="800" border="0">
            <tr> 
              <td width="180" class="LABEL">状态:</td>
              <td width="140" > 	
                <select name="status" id="PDStatus"  onchange="changeEffDate(this.options[this.options.selectedIndex].value)">
    				<option value="0"  selected  > </option>
                    <option value="1" > 未申请 </option>
                    <option value="2" > 申请通过</option>
                    <option value="3" > 已撤销 </option>
                </select>
              </td>
              <td width="120" class="LABEL">生效日期:</td>
              <td width="134"> 
                <input type="text" name="effectiveDate" id="effectiveDate" maxlength="10" size="12"  value="">
              </td>
              <td width="140" class="LABEL">&nbsp;</td>
              <td width="120"> &nbsp;
              </td>
            </tr>
          </table>
    

    script函数:

    function changeEffDate(num){
    	var Termdte = "";//yyyy/MM/dd
    	var dateNow = getNowFormatDate();
    	if("1"==num) document.getElementById("effectiveDate").value =Termdte;
    	if("23".indexOf(num)>=0) document.getElementById("effectiveDate").value =dateNow;
    	if("0"==num)document.getElementById("effectiveDate").value="";
    } 
    
  • 相关阅读:
    WPF之长短
    MFC程序和Win32程序的关系
    .NET Framework/CLR之长短
    常用软件
    经典推荐.Net面试法宝
    socket编程原理
    常用开发工具
    Get和Post方法的区别
    MAC IP等相关
    Datagrid为什么不自动换行显
  • 原文地址:https://www.cnblogs.com/DiZhang/p/12544887.html
Copyright © 2020-2023  润新知