Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
EnterJSF ページでキーを無効にしたいと考えています。私はJavaScriptが初めてです。JS で可能な場合、JS と Primefaces コンポーネントをバインドするにはどうすればよいですか。
すべてのコンポーネントには ID があります。ID がない場合は ID を作成します。JS は誰と作業しているかを知る必要があります。
これがコードの平和です。それはjQueryです:
$('#your_element_id').keypress(function(e) { if ( event.which == 13 ) { event.preventDefault(); } });
enter何かを実行するのをブロックします。
enter