검색결과 리스트
글
출처 : http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem
http://blog.naver.com/PostView.nhn?blogId=lcoguss&logNo=199048137
html의 input 에서 문자 입력 후에 enter를 누를 시 dialog가 닫혀버리는 현상이 있다.
아래처럼 keyCode가 13일때 아무런 처리를 하지 않으면 된다.
$('.dialog').find('input').keypress(function(e) { if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { //$(this).parent().parent().parent().parent().find('.ui-dialog-buttonpane').find('button:first').click(); /* Assuming the first one is the action button */ return false; } });
'IT분야 > Javascript' 카테고리의 다른 글
[Jquery]html 동적추가할 경우 Jquery datepicker 추가 (0) | 2013.12.17 |
---|---|
[JavaScript]jquery dialog enter 누를시 닫히는 현상 (0) | 2013.12.15 |
[JAVASCRIPT]JSON 오류검사 (1) | 2013.02.26 |
jquery ui datepicker (0) | 2012.11.04 |