longmatch
Programmer
- Nov 1, 2001
- 406
Dear Friend:
I wrote this piece of code to verify the data filled on the form. It did popup a message box. But the form was still submitted and went to the another form, whenever I clicked the ok button or cancel button.
Anybody knows how to keep to current page before correction?
Haijun
<script language="VBScript">
dim validation
function ProcedureData_onSubmit
validation=true
if not(isdate(document.ProcedureData.dateofProc.value)) then
msgbox "not a correct date format", 1
validation = false
end if
if validation = true then
ProcedureData_onSubmit=true
else
ProcedueData_onSubmit=false
end if
end function
</Script>
I wrote this piece of code to verify the data filled on the form. It did popup a message box. But the form was still submitted and went to the another form, whenever I clicked the ok button or cancel button.
Anybody knows how to keep to current page before correction?
Haijun
<script language="VBScript">
dim validation
function ProcedureData_onSubmit
validation=true
if not(isdate(document.ProcedureData.dateofProc.value)) then
msgbox "not a correct date format", 1
validation = false
end if
if validation = true then
ProcedureData_onSubmit=true
else
ProcedueData_onSubmit=false
end if
end function
</Script>