2015年12月7日月曜日

テキスト入力でEnterを押してもsubmitさせない方法

<input type="text">でEnterを押してもsubmitさせない方法

http://www.programming-magic.com/20080119212425/





<script>
function nosubmit(event){
if (event) var event = window.event;
if (event.keyCode == 13) return false;
}
</script>

<form><input type="text" onkeypress="return nosubmit(event);" /></form>