2011-06-01 38 views

回答

1

我不知道是否Drupal有自動執行此或使其更容易,但只是正常的HTML的JavaScript你會做它喜歡的任何特殊的方式:

<input type="submit" onClick="doStuff();" value="Submit"> //Note: you can use return(doStuff()); and if doStuff returns false then the form will not submit (great for checking if all fields are filled out correctly). 
2

例如,這裏是你如何能執行一些

$('form#contact-mail-page input#edit-submit').click(function() { alert('do some stuff'); }); 
1

可以使用的

'#attributes' => array('onclick' => 'if(confirm('.$msg.')) return true; return false;')); 
此屬性:它使用jQuery提交之前Drupal的接觸形式JS
相關問題