var birth = document.getElementsById('birth_day');
var regExp = /^([0-9]{4})-([0-9]{2})-([0-9]{2})/g;

if(!regExp.test(birth)) { 
alert("정확한 날짜 형식을 써주세요.");
return false;
}

g : 전역매칭.
i : 대소문자 구분 안함.

'Technology > Programming' 카테고리의 다른 글

JAVA / 파일처리  (0) 2009.12.01
Python / 날짜 계산하기  (0) 2009.11.07
Python / Python 2.x에서 3.x로 업그레이드 되면서 변한것 들  (0) 2009.10.30
JSP / Session 제거  (0) 2009.10.28
Javascript / 페이지이동  (0) 2009.10.28

+ Recent posts