COMING SOON 🚀

s

자바스크립트 폼체크에서 해방되세요//

<?

function sendIt($f,$arr,$opt="",$preOpt="") {
$RE="function sendIt(f) {";
$RE.=$preOpt;
while (list($key,$val)=each($arr)) {
$RE.="
if (!document.".$f.".".$key.".disabled) {
";
$RE.="
if (document.".$f.".".$key.".value=='') {
alert('".$val."(을)를 입력해 주세요');
document.".$f.".".$key.".focus(); return false;
}
";
$RE.="
}
";
}
$RE.=$opt;
$RE.="document.".$f.".submit();";
$RE.="}";
return $RE;
}

//사용예제
?>

<script language=javascript>
<?
$arr=array("company"=>"회사","name"=>"이름","tel"=>"전화번호");
echo sendIt("form1",$arr);
?>
</script>
<form name=form1 action='<?=$PHP_SELF?>'>
회사 : <input name=company><br>
이름 : <input name=name><br>
전화 : <input name=tel><br>
<input type=button onclick='sendIt(this.form);' value='확인'>
</form>
01<?
02
03 function sendIt($f,$arr,$opt="",$preOpt="") {
04 $RE="function sendIt(f) {";
05 $RE.=$preOpt;
06 while (list($key,$val)=each($arr)) {
07 $RE.="
08 if (!document.".$f.".".$key.".disabled) {
09 ";
10 $RE.="
11 if (document.".$f.".".$key.".value=='') {
12 alert('".$val."(을)를 입력해 주세요');
13 document.".$f.".".$key.".focus(); return false;
14 }
15 ";
16 $RE.="
17 }
18 ";
19 }
20 $RE.=$opt;
21 $RE.="document.".$f.".submit();";
22 $RE.="}";
23 return $RE;
24 }
25
26//사용예제
27?>
28
29<script language=javascript>
30<?
31$arr=array("company"=>"회사","name"=>"이름","tel"=>"전화번호");
32echo sendIt("form1",$arr);
33?>
34</script>
35<form name=form1 action='<?=$PHP_SELF?>'>
36회사 : <input name=company>
37이름 : <input name=name>
38전화 : <input name=tel>
39<input type=button onclick='sendIt(this.form);' value='확인'>
40</form>
|

댓글 1개

와 좋네요 감사합니다.
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
12년 전 조회 2,123
12년 전 조회 1,934
12년 전 조회 3,742
12년 전 조회 9,998
12년 전 조회 2,296
12년 전 조회 2,245
12년 전 조회 2,691
12년 전 조회 2,163
12년 전 조회 2,314
12년 전 조회 4,577
12년 전 조회 2,520
12년 전 조회 3,190
12년 전 조회 2,184
12년 전 조회 2,345
12년 전 조회 4,069
12년 전 조회 1,915
12년 전 조회 2,408
12년 전 조회 2,726
12년 전 조회 3,170
12년 전 조회 3,271
12년 전 조회 3,742
12년 전 조회 2,176
12년 전 조회 2,210
12년 전 조회 5,591
12년 전 조회 2,640
12년 전 조회 2,823
12년 전 조회 6,668
12년 전 조회 4,396
12년 전 조회 3,310
13년 전 조회 2,494
13년 전 조회 4,665
13년 전 조회 3,659
13년 전 조회 3,361
13년 전 조회 3,008
13년 전 조회 2,699
13년 전 조회 2,703
13년 전 조회 2,437
13년 전 조회 3,545
13년 전 조회 2,851
13년 전 조회 2,509
13년 전 조회 3,570
13년 전 조회 2,784
13년 전 조회 3,381
13년 전 조회 4,602
13년 전 조회 2,376
13년 전 조회 3,370
13년 전 조회 2,190
13년 전 조회 2,661
13년 전 조회 3,290
13년 전 조회 2,931
13년 전 조회 5,719
13년 전 조회 3,841
13년 전 조회 4,038
13년 전 조회 2,383
13년 전 조회 9,699
13년 전 조회 4,545
13년 전 조회 2,597
13년 전 조회 2,466
13년 전 조회 3,863
13년 전 조회 6,581
13년 전 조회 4,591
13년 전 조회 2,514
13년 전 조회 1.5만
13년 전 조회 2,395
13년 전 조회 1,809
13년 전 조회 5,102
13년 전 조회 2,602
13년 전 조회 1만
13년 전 조회 1,987
13년 전 조회 2,410
13년 전 조회 4,447
13년 전 조회 2,043
13년 전 조회 2,941
13년 전 조회 4,883
13년 전 조회 2,256
13년 전 조회 2,169
13년 전 조회 6,528
13년 전 조회 2,629
13년 전 조회 1,954
13년 전 조회 3,698
13년 전 조회 3,717
13년 전 조회 2,672
13년 전 조회 4,114
13년 전 조회 7,787
13년 전 조회 3,365
13년 전 조회 1,933
13년 전 조회 3,101
13년 전 조회 3,042
13년 전 조회 3,834
13년 전 조회 1,801
13년 전 조회 2,900
13년 전 조회 1,949
13년 전 조회 2,993
13년 전 조회 3,887
13년 전 조회 2,382
13년 전 조회 5,085
13년 전 조회 1.1만
13년 전 조회 2,357
13년 전 조회 3,699
13년 전 조회 3,324