其他元素旁边的元素 Zend Form

发布于 2024-12-20 20:21:44 字数 1495 浏览 6 评论 0原文

我的表单中有两个元素:

$element = new Zend_Form_Element_Text('valor_causa');
$element->setLabel('Valor da Causa: R$')
            ->setAttrib('class', 'moneyField')
            ->addValidator(new Zend_Validate_Float(array('locale' => 'pt_BR')));
$this->addElement($element);
$element = new ZendX_JQuery_Form_Element_DatePicker('data_valor_causa');
$element->setLabel('Data do valor da causa:')
            ->addValidator(new Zend_Validate_Date(array('format' => 'dd/MM/yyyy')))
            ->setJQueryParam('dateFormat', 'dd/mm/yy')
            ->setAttrib('onkeypress', 'mascara(this,Data)')
            ->setAttrib('maxlength', '10');
$this->addElement($element);

它生成以下 html 代码:

<dt id="valor_causa-label"><label class="optional" for="valor_causa">Valor da  Causa:R$</label></dt>
<dd id="valor_causa-element"><input type="text" class="moneyField" value="" id="valor_causa" name="valor_causa"></dd>
<dt id="data_valor_causa-label"><label class="optional" for="data_valor_causa">Data do valor da causa:</label></dt>
<dd><input type="text" maxlength="10" onkeypress="mascara(this,Data)" value="" id="data_valor_causa" name="data_valor_causa" class="hasDatepicker"></dd>

在此处输入图像描述 我该怎么做才能让一个元素与另一个元素相邻?就像上图一样。我尝试删除所有装饰器,但 datapicker 不允许我删除所有装饰器。我尝试了一些 CSS 但没有成功。

I have two elements in my form:

$element = new Zend_Form_Element_Text('valor_causa');
$element->setLabel('Valor da Causa: R

It generates the following html code:

<dt id="valor_causa-label"><label class="optional" for="valor_causa">Valor da  Causa:R
lt;/label></dt>
<dd id="valor_causa-element"><input type="text" class="moneyField" value="" id="valor_causa" name="valor_causa"></dd>
<dt id="data_valor_causa-label"><label class="optional" for="data_valor_causa">Data do valor da causa:</label></dt>
<dd><input type="text" maxlength="10" onkeypress="mascara(this,Data)" value="" id="data_valor_causa" name="data_valor_causa" class="hasDatepicker"></dd>

enter image description here
What could I do to let one element next to the other? like the picture above. I have tried removing all decorators but datapicker doesnt let me remove all. I tried some CSS but no sucess.

) ->setAttrib('class', 'moneyField') ->addValidator(new Zend_Validate_Float(array('locale' => 'pt_BR'))); $this->addElement($element); $element = new ZendX_JQuery_Form_Element_DatePicker('data_valor_causa'); $element->setLabel('Data do valor da causa:') ->addValidator(new Zend_Validate_Date(array('format' => 'dd/MM/yyyy'))) ->setJQueryParam('dateFormat', 'dd/mm/yy') ->setAttrib('onkeypress', 'mascara(this,Data)') ->setAttrib('maxlength', '10'); $this->addElement($element);

It generates the following html code:

enter image description here
What could I do to let one element next to the other? like the picture above. I have tried removing all decorators but datapicker doesnt let me remove all. I tried some CSS but no sucess.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神经大条 2024-12-27 20:21:44

使用 float 对我有用:

dt {
    float: left;
    margin-right: 20px;
}

dd {
    float: left;
    margin-right: 50px;  
}

Using float works for me:

dt {
    float: left;
    margin-right: 20px;
}

dd {
    float: left;
    margin-right: 50px;  
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文