>I am new to VB script and I am trying to add validation to a form created by our web developer. Everytime my validation fires off. My messagebox appears but then the form still goes through the submit process. I can't get it to stop and then set focus on the problem.
>
>Here is the code for the script:
>
>SCRiPT LANGUAGE="VBScript"
>Option Explicit
> Sub cmdSubmit_OnClick
>
> Check to see if the user entered anything.
>
> If (Len(document.form1.FirstName.value) = 0) Then
>
> MsgBox "You must enter your firstname before submitting."
>
> Exit Sub
>
> End If
> End Sub
>/SCRiPT
>
>Here is the code for the submit button:
>
> form name="form1" method="post" action="%=MM_editAction%"
>
> --- Form contents
>
> P
> input type="Submit" name="cmdSubmit" value="Join Us"
>
> input type="reset" name="Reset" value="Clear"
>
>
> /p
>
>
> /form
>
>
You don't appear to be doing anything to stop execution. Once the msgbox fires, you are continuing the operation - unless I'm missing something.
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown