0

在此处输入图像描述

如您所见,日期时间输入类与其他输入类一样。我使用 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')))
));
4

1 回答 1

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>
于 2013-09-11T13:47:55.720 回答