我已经制作了一个 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/