Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form Validation
Message
 
To
23/08/2000 08:14:13
Todd Wolfe
Certified Marketing Services
Kinderhook, New York, United States
General information
Forum:
Internet
Category:
VBScript
Title:
Miscellaneous
Thread ID:
00408164
Message ID:
00408214
Views:
9
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform