html - 是否可以将 HTML 表单转换为网络表单? Drupal的

标签 html css drupal drupal-forms drupal-webform

我已经制作了一个 HTML 表单并设置了样式,是否可以将其放入 Drupal 中的网络表单中,而无需重新创建所有内容?我的意思是,是否可以使用 id 和类来使 webform 模块获取提交的结果?

最佳答案

答案好坏参半。您可以重用您已经在 html 表单中完成的样式,但这并不像在 drupal 中复制粘贴 html 表单那么简单。

您需要使用 drupal form api为此目的。

Drupal 6 表单示例:http://drupal.org/node/717734
Drupal 7 表单示例:http://drupal.org/node/717740

Drupal 6 字段示例:

$form['title'] = array(
  '#type' => 'textfield',
  '#title' => t('Page title'),
  '#attributes' => array(
    'class' => 'page-title', 
  ),
);

Drupal 7 字段示例:

$form['title'] = array(
  '#type' => 'textfield',
  '#title' => t('Page title'),
  '#attributes' => array(
    'class' => array('page-title'), 
  ),
);

关于html - 是否可以将 HTML 表单转换为网络表单? Drupal的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16733999/

相关文章:

javascript - 向 HTML 表格添加过滤

css - 像菜单一样的 Engadget - 字体不匹配

drupal - 显示 YouTube 视频主页 Drupal

html - CSS 中垂直对齐的问题

php - 如何在php中压缩html输出?

javascript - 多选列表,每个项目都有数量选项

javascript - 为什么我的 jquery 插件在我将它放入 div 容器后停止工作?

css - 在 IE 9 中使用 Css3 固定渐变

linux - Docker Nginx工作进程以非root用户身份运行,但仍然可以访问root拥有的文件

wordpress - Plone 是否足以跟上其他 CMS 的步伐?