[Drupal] 在 autocomplete 欄位按 enter 鍵會 trigger 第一個 ajax button 的問題

By gloomcheng, 15 October, 2014

像是在 autocomplete 的 tag 欄位輸入資料並按 Enter 鍵後,結果觸發了 insert 按鈕,又把圖插入到內文區,此時只要在版型的 js 檔寫入一小段程式就可以改善

//fix enter key triggering button click on autocomplete fields.   $('input.form-autocomplete').keydown(function(e) {return e.keyCode != 13});

Ref: https://www.drupal.org/node/482558#comment-1670326

Plain text

  • No HTML tags allowed.
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.