标签:form 日期控件 取消 day 格式 picker fse oct switch
代码如下:
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title>根据条件决定My97DatePicker日期控件弹出的日期格式</title> 6 <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" /> 7 </head> 8 <body> 9 10 <div class="row"> 11 <div class="col-md-6 col-md-offset-3"> 12 <div class="panel panel-default m-top"> 13 <div class="panel-heading">上传</div> 14 <div class="panel-body"> 15 <form method="" action="" class="form-horizontal"> 16 <div class="form-group form-group-sm"> 17 <label for="bfjis" class="col-sm-4 control-label">是否按日:</label> 18 <div class="col-sm-4"> 19 <select name="bfjis" id="bfjis" class="form-control"> 20 <option value="0">是</option> 21 <option value="1">否</option> 22 </select> 23 </div> 24 </div> 25 <div class="form-group form-group-sm"> 26 <label for="tranDate" class="col-sm-4 control-label">交易日/月:</label> 27 <div class="col-sm-4"> 28 <input type="text" id="tranDate" name="tranDate" class="form-control Wdate" onfocus="selDate()" /> 29 </div> 30 </div> 31 <div class="form-group form-group-sm"> 32 <label for="Excelfile" class="col-sm-4 control-label">Excel文件:</label> 33 <div class="col-sm-4"> 34 <input type="file" name="Excelfile" id="Excelfile" value="" /> 35 </div> 36 </div> 37 38 <div class="col-sm-offset-4"> 39 <button type="submit" class="btn btn-primary btn-sm"> 40 <i class="glyphicon glyphicon-saved"></i> 保存 41 </button> 42 <button onclick="back();" class="btn btn-sm btn-danger" type="button"> 43 <i class="glyphicon glyphicon-remove-circle"></i> 取消 44 </button> 45 </div> 46 </form> 47 </div> 48 </div> 49 </div> 50 </div> 51 <script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script> 52 <script src="js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script> 53 <script src="My97DatePicker/WdatePicker.js"></script> 54 <script> 55 // 根据条件决定My97DatePicker日期控件弹出的日期格式 56 var bfjis=$(‘#bfjis‘).val(); 57 $(‘#bfjis‘).change(function(){ 58 bfjis = $(‘#bfjis‘).val(); 59 // alert("1:"+bfjis) 60 }) 61 function selDate(){ 62 switch (bfjis) { 63 case "1": 64 WdatePicker({ dateFmt: ‘yyyy-MM‘, minDate:‘2016-1‘,maxDate:‘2099-12‘,isShowToday: false, isShowClear: false, readOnly:true }); 65 break ; 66 case "0": 67 WdatePicker({dateFmt: ‘yyyyMMdd‘, readOnly:true}); 68 break; 69 } 70 } 71 </script> 72 </body> 73 </html>
根据条件决定My97DatePicker日期控件弹出的日期格式
标签:form 日期控件 取消 day 格式 picker fse oct switch
原文地址:http://www.cnblogs.com/ljblog/p/7778074.html