方法1:
コードコピーは次のとおりです。
<script type = "text/javascript" event = "onkeydown" for = "document">
if(event.keycode == 13)
{
var button = document.all( "<%= buttondorupdate.clientId%>");
button.focus();
button.click();
}
</script>
方法2:
コードコピーは次のとおりです。
<入力型= "button" onclick = "noclick()" style = "マージントップ:-1024px;" id = "nousebutton" />
<script type = "text/javascript" event = "onkeydown" for = "document">
if(event.keycode == 13)
{
var button = document.getElementById( "nouseButton");
button.focus();
button.onclick();
}
</script>
<スクリプト>
function noclick()
{
falseを返します。
}
</script>
注:ユーザーにコントロールが表示されないようにします
1:属性を非表示にします
2:インターフェイスの外に置きます
方法3:
ブロックページキャリッジリターンイベント
フォームIDに次のコンテンツを追加します。
コードコピーは次のとおりです。
method = "post" onkeydown = "if(event.keycode == 13)return false;"