일(job)/FRONT
[Jquery] .keypress(), 검색조건입력 후 엔터키 선택시 검색실행
뽀&쏭
2016. 1. 21. 11:30
|
|
// 내 용 : 검색조건 입력후 엔터키 선택시 검색이 되도록함.
// 대상컨트롤 : input type = text, ID = "txt" 포함. (radio, checkboc, hidden, password 컨트롤 제외)
// 그 이외의 컨트롤을 제어해주지 않으면 postback이 일어나는 문제가 있어 엔터키가 적용되지 않도록 함.
// 작성자 : 최보현(bhchoi@00db.co.kr)
// 작성일 : 2010/12/22
$('input').not(':password,:checkbox,:radio','hidden').each(function(){
if($(this).attr("id").indexOf("_0230") != -1) {
$(this).keypress(function() {
if (event.keyCode == '13') {
btnFind();
return false;
}
});
} else {
$(this).keypress(function() {
return false;
});
}
});