<SCRIPT language="VBScript">
' *********************************************************
' ローカルスクリプトのグローバル変数
' *********************************************************
Dim ButtonFlg
' **********************************************************
' フォームのチェック
' **********************************************************
function frmMain_onSubmit()
if ButtonFlg = 1 then
if Trim( document.all("In1CodeNew").value ) = "" then
alert("商品分類を入力して下さい")
document.all("In1CodeNew").focus
frmMain_onSubmit = false
exit function
end if
if Trim( document.all("In1NameNew").value ) = "" then
alert("名称を入力して下さい")
document.all("In1NameNew").focus
frmMain_onSubmit = false
exit function
end if
if not confirm( "新規登録を行いますか?" ) then
frmMain_onSubmit = false
exit function
end if
end if
if ButtonFlg = 2 then
if Trim( document.all("In1CodeUpd").value ) = "" then
alert("商品分類がセットされていません")
frmMain_onSubmit = false
exit function
end if
if Trim( document.all("In1NameUpd").value ) = "" then
alert("名称を入力して下さい")
document.all("In1NameUpd").focus
frmMain_onSubmit = false
exit function
end if
if not confirm( "修正更新を行いますか?" ) then
frmMain_onSubmit = false
exit function
end if
end if
frmMain_onSubmit = true
end function
</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
<TITLE>PHP 雛形</TITLE>
<STYLE>
.MyCell {
background-color:silver
}
</STYLE>
</HEAD>
<BODY>
<FORM
name=frmMain
method=GET
action=control.php
target=BodyFrame
onSubmit='return CheckData()'
>
<TABLE border=0 bgcolor=black cellspacing=1 cellpadding=5>
<TR>
<!-- *******************************************************
入力 (上段)
******************************************************** -->
<TD class=MyCell rowspan=2>商品分類</TD>
<TD class=MyCell>
<INPUT
type=text
maxlength=3
size=5
name=In1CodeNew
value="<?= $_POST['In1CodeNew'] ?>"
>
</TD>
<TD class=MyCell rowspan=2>名 称</TD>
<TD class=MyCell>
<INPUT
type=text
maxlength=25
size=50
name=In1NameNew
value="<?= $_POST['In1NameNew'] ?>"
>
</TD>
<!-- *******************************************************
送信ボタン
******************************************************** -->
<TD class=MyCell>
<INPUT type=submit name=send value="新規" onClick='ButtonFlg=1'>
</TD>
<!-- *******************************************************
画面初期化ボタン
******************************************************** -->
<TD class=MyCell rowspan=2>
<INPUT
type=button
value="Cancel"
onClick='top.location="frame.htm"'
>
</TD>
</TR>
<TR>
<!-- *******************************************************
入力 (下段)
******************************************************** -->
<TD class=MyCell>
<INPUT
type=text
maxlength=3
size=5
readonly
style='background-color:silver'
name=In1CodeUpd
value="<?= $_POST['In1CodeUpd'] ?>"
>
</TD>
<TD class=MyCell>
<INPUT
type=text
maxlength=25
size=50
name=In1NameUpd
value="<?= $_POST['In1NameUpd'] ?>"
>
</TD>
<!-- *******************************************************
送信ボタン
******************************************************** -->
<TD class=MyCell>
<INPUT type=submit name=send value="修正" onClick='ButtonFlg=2'>
</TD>
</TR>
</TABLE>
<!-- *******************************************************
画面ID
******************************************************** -->
<INPUT type=hidden name=GNO value="<?= PASS_HEAD ?>">
</FORM>
</BODY>
</HTML>
|