Gon*_*ero 5 forms api drupal onclick button
我需要这样做,但使用Drupal形式:
<input type="button" class="button-user" value="Back" onclick="location.href='edit'"/>
Run Code Online (Sandbox Code Playgroud)
我试过这样做,但它不起作用:
$form['back']['#prefix'] = "<input type='button' class='button-user' value='Back' onclick='location.href='edit''/>;
Run Code Online (Sandbox Code Playgroud)
并且:
$form['back'] = array(
'#type' => 'button',
'#value' => 'Back',
'#attributes' => array(
'class' => 'button-user',
'onclick' => 'location.href=edit',
)
);
Run Code Online (Sandbox Code Playgroud)
$form['back']['#markup'] = "<input type='button' class='button-user' value='Back' onclick='location.href=\'edit\''/>";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7994 次 |
| 最近记录: |