Option1
如果您想使用自定义 html,您应该使用 'markup' 或 'item' 表单元素
$form['reset'] = array(
'#type' => 'markup'
'#markup' => '<input class="form-button" type="reset" value=" Reset " />',
'#weight' => 1001,
);
选项 2使用 javascript 和按钮
$form['actions']['reset'] = array(
'#type' => 'button',
'#value' => t('Reset'),
'#weight' => 1001,
'#validate' => array(),
'#attributes' => array('onclick' => 'this.form.reset(); return false;'),
);
Optoin 3您可以将链接添加到同一页面并将其设置为按钮
$form['reset'] = array(
'#type' => 'markup'
'#markup' => '<a href="/contact">' .t('Reset') . '<a/>',
'#weight' => 1001,
);
选项 4添加在提交时不会执行任何操作的提交或按钮。