BRR.js
1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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();
}