drupal 6 中的自定义表单模板中未显示错误消息?
我在 template.php 中使用以下函数执行此操作
function mytheme_theme() {
return array(
'nsa_create_form' => array(
'arguments' => array('form' => NULL),
'template' => 'nsa-create',
),
);
}
,并添加了 nsa-create.tpl.php 以及以下代码行,
<?php if ($show_messages && $messages): print $messages; endif; ?>
<?= drupal_render($form['start_date']) ?>
<?= drupal_render($form['end_date']) ?>
<?= drupal_render($form['confirm_dates']) ?>
<?= drupal_render($form['name']) ?>
<?= drupal_render($form['emp_id']) ?>
<?= drupal_render($form['client']) ?>
<?= drupal_render($form['designation']) ?>
<?= drupal_render($form['manager']) ?>
<?= drupal_render($form['competency']) ?>
<?= drupal_render($form['wrapper_nsa']) ?>
<?= drupal_render($form['submit']) ?>
其正确呈现,但不显示错误/验证消息,并且无效字段没有红色边框。
I did this using below function in template.php
function mytheme_theme() {
return array(
'nsa_create_form' => array(
'arguments' => array('form' => NULL),
'template' => 'nsa-create',
),
);
}
And added nsa-create.tpl.php with the below lines of code
<?php if ($show_messages && $messages): print $messages; endif; ?>
<?= drupal_render($form['start_date']) ?>
<?= drupal_render($form['end_date']) ?>
<?= drupal_render($form['confirm_dates']) ?>
<?= drupal_render($form['name']) ?>
<?= drupal_render($form['emp_id']) ?>
<?= drupal_render($form['client']) ?>
<?= drupal_render($form['designation']) ?>
<?= drupal_render($form['manager']) ?>
<?= drupal_render($form['competency']) ?>
<?= drupal_render($form['wrapper_nsa']) ?>
<?= drupal_render($form['submit']) ?>
its rendered properly but error/validation messages are not displayed and no red border for invalid fields.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的page.tpl.php有吗
does your page.tpl.php have