How to validate forms with VBScript Part 2

Introduction

As discussed in Part 1 of How to validate forms with VBScript, this second article we will look at the validation of specific data.

Very often, just ensuring that a form field is populated is not enough, the data being entered is specific (Phone numbers, credit card numbers, email addresses etc) and we can use VBScript to ensure the data entered is what we want.

$2.79
- OR -

Overview

Some basics again

The trigger for our validation event will be on Submission or in VBScript language onSubmit and we will perform our field validation on a form that we will call frmInput. This Function will be called when the form is submitted and we must declare what language the script is written in and ensure all of the Function is contained within <script>  </script> tags.

<html>

<head>

      <script language="VBScript">

            <!—-Function must stay inside these tags -->

     

      </script>

</head>

To ensure our Function will run when the form is submitted we add the onSubmit action to the Function. When frmInput is submitted our Function will run.

Reviews

Be the first to write a review

You must me logged in to write a review.