我想从特定的 Drupal 网络表单中删除提交按钮,这可能吗?如果可以,我该怎么做?
如果可能的话,我还想从同一个表单中删除上一个按钮。
最佳答案
如@googletop 所示,您需要使用 hook_form_alter() 来定位和更改该表单
要取消提交,可以在自定义模块中执行以下操作:
<?php
function my_custom_module_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'webform_client_form_130') {
if ($thiscondition && $thatcondition){
unset($form['actions']['submit']);
}
}
}
?>
与“上一个”按钮相同,您只需要在表单数组中找到它
关于drupal - 如何从特定的 Drupal 网络表单中删除提交按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5231647/