我想改变选择日期后文本框上显示的日期格式。我尝试了格式表和其他编码在谷歌找到,但它不工作。
<form action="report_emp.php" method="post">
<input name="id" type="hidden" value="<?php echo $_GET['id'];?>">
<table class="table table-striped table-bordered bootstrap-datatable datatable">
<tbody>
<tr>
<td>From</td>
<td>
<div class="control-group">
<label class="control-label" for="date01">Date</label>
<div class="controls">
<input type="text" class="input-xlarge datepicker" id="date01" name="datefrom" value="mm/dd/yy">
</div>
</div>
</td>
<td>To</td>
<td>
<div class="control-group">
<label class="control-label" for="date02">Date</label>
<div class="controls">
<input type="text" class="input-xlarge datepicker" id="date02" name="dateto" value="mm/dd/yy">
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Find Client Details</button>
<button class="btn">Cancel</button>
</div>
</form>
如果您正在谈论jquery日期拾取器,那么您可以使用:
$( "#datepicker" ).datepicker( "option", "dateFormat", "mm/dd/yy" );
检查这里。