Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form Validation
Message
 
À
23/08/2000 08:14:13
Todd Wolfe
Certified Marketing Services
Kinderhook, New York, États-Unis
Information générale
Forum:
Internet
Catégorie:
VBScript
Titre:
Divers
Thread ID:
00408164
Message ID:
00408214
Vues:
10
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform