如您所见,日期时间输入类是其他输入的类。我使用了twitter bootstrap 但如何更改日期时间输入内部输入类? (没有黑客表格助手)
这是我的日期时间选择器输入:
echo $this->Form->input('issue_date');
以及如下所示的表单:
echo $this->Form->create('Certificate',array('class'=>'form-horizontal','inputDefaults' => array(
'format' => array('before', 'label', 'between', 'input', 'error', 'after'),
'div' => array('class' => 'control-group'),
'label' => array('class' => 'control-label'),
'between' => '<div class="controls">',
'after' => '</div>',
'error' => array('attributes' => array('wrap' => 'span', 'class' => 'help-inline')))
));
答案 0 :(得分:0)
这样可以正常工作。
echo $this->Form->input('issue_date', array('class' => 'your class name'));
以上将生成这样的输出
<div class="input datetime">
<select name="data[Certificate][issue_date][month]" class="your class name" id="CertificateIssueDateMonth">
// options
</select>-
<select name="data[Certificate][issue_date][day]" class="your class name" id="CertificateIssueDateDay">
// options
</select>-
<select name="data[Certificate][issue_date][year]" class="your class name" id="CertificateIssueDateYear">
// options
</select>
<select name="data[Certificate][issue_date][hour]" class="your class name" id="CertificateIssueDateHour">
</select>:
<select name="data[Certificate][issue_date][min]" class="your class name" id="CertificateIssueDateMin">
// options
</select>
<select name="data[Certificate][issue_date][meridian]" class="your class name" id="CertificateIssueDateMeridian">
// options
</select>
</div>