입력값의 판단

1868 단어 판단


function opencourse(cid,uid,utype) {
	alert(cid);
	var objstr=document.getElementById('lessonnum'+cid);
//	var lessonnumber =$('lessonnum'+cid).value.trim();
//	var lessonnumber = $('lessonnum'+cid);
//	var lessonnumber=document.getElementById('lessonnum'+cid).value;
	var lessonnumber=objstr.value;
	alert("lessonnumber"+lessonnumber);
  if(lessonnumber==""){
		alert(' ');
		objstr.focus();
	} else if(!isNumeric(lessonnumber)){
		alert(' 0 ');
		objstr.focus();
	} else if(lessonnumber<1){
		alert(' 0 ');
		objstr.focus();
	} else {
	//	window.location.href='admincp.php?ac=student&op=opencourse&cid='+cid+'&uid='+uid+'&perpage='+perpage+'&page='+page+'&tab='+tab+'&lessonnumber='+lessonnumber+'&type=2';
		window.location.href='openremedial.action?userid='+uid+'&courseid='+cid+'&totallessonnumber='+lessonnumber+'&utype=2';
		return true;
	}
}
function isNumeric(num){
	  var reNum=/^\d*$/;
	  return(reNum.test(num));
	}
function warning(obj, msg) {
	if((ton = obj.id.substr(5, obj.id.length)) != 'password2') {
		$(ton).select();
	}
	obj.style.display = '';
	obj.innerHTML = '<img src="image/check_error.gif" width="13" height="13"> &nbsp; ' + msg;
	obj.className = "warning";
}
function clearing(obj) {
	obj.style.display = '';
	obj.innerHTML = '';
	obj.className = '';
}








좋은 웹페이지 즐겨찾기