BRR.js 1.81 KB
function Modoru(){
		document.frm.action = "SIM0100.php";
		document.frm.method = "POST";
		document.frm.submit();
	}
function Hyo(){
		document.frm.action = "BRR0500.php";
		document.frm.method = "POST";
		document.frm.submit();
	}

function chk_up(flg){
var txtName1 = "";
var txtName2 = "";
var icnt = 0 ;
	if (flg==1) {
		txtName1 = "txtin1[]";
	}else{
		txtName1 = "txtout1[]";
	}
	if(document.frm.elements[txtName1].length > 0){
		icnt = eval(document.frm.elements[txtName1].length);
	}else{
		icnt = 1;
	}
	for(i=0;i<icnt;i++){
		for(j=1;j<=12;j++){
			if (flg==1) {
				txtName2 = "txtin"+j+"[]";
			}else{
				txtName2 = "txtout"+j+"[]";
			}
			//数値チェック
			if (icnt==1){
				val = document.frm.elements[txtName2].value;
			}else{
				val = document.frm.elements[txtName2][i].value;
			}
			//数値チェック
		    if (val.match(/[^0-9.]/g) && val != "") {
		        alert("数値以外が含まれています。");
				if (icnt==1){
					document.frm.elements[txtName2].focus();
				}else{
					document.frm.elements[txtName2][i].focus();
				}
		        return false;
		    }
			//マイナスチェック
		    if (eval(val) < 0) {
		        alert("負の数は入力できません");
				if (icnt==1){
					document.frm.elements[txtName2].focus();
				}else{
					document.frm.elements[txtName2][i].focus();
				}
		        return false;
		    }
			//桁数チェック
			if (icnt==1){
				val = document.frm.elements[txtName2].value.length;
			}else{
				val = document.frm.elements[txtName2][i].value.length;
			}
		    if (val > 9) {
		        alert("金額が大き過ぎます。");
				if (icnt==1){
					document.frm.elements[txtName2].focus();
				}else{
					document.frm.elements[txtName2][i].focus();
				}
		        return false;
		    }
		}
	}
	document.frm.target = "_self";
	document.frm.action = "SIM0211.php";
	document.frm.method="POST";
	document.frm.submit();
}