Wrox Programmer Forums
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 31st, 2004, 03:27 PM
Authorized User
Join Date: Feb 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default validating input

I am trying to validate my input by writing a client side vbscript, but it is not working and I don't have errors, but it's not validating my input. Here's the code:

<% Response.Expires = 0 %>
<% Response.Buffer = False %>
Password verification are you caching

<Title>Passoword change website</title>
<h2>Try changing your password</h2>
are you caching
<form method=post action="start2201.asp" NAME=frmUser>
<p>Please enter your student id:</p>
<p><INPUT type="text" name="StudentId" size="10"></p>
<p>Please enter your student old password:</p>
<p><INPUT type="password" name="Password"></p>
<p>Please enter your newpassword:</p>
<p><INPUT type="password" name="NewPassword"></p>
<p>Please verify your new password:</p>
<p><INPUT type="password" name="VerifyPassword"></p>

<p><input type="submit" value="Submit"><input type="reset" value="Reset"></p>

<SCRIPT language="vbscript">
Sub VerifyData()
          If Len(frmUser.NewPassword.value) = 0 then
        Alert ("You must enter a password")
                Exit Sub
    end if
Call frmUser.submit()
End Sub


Reply With Quote
  #2 (permalink)  
Old April 1st, 2004, 04:30 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post

Is this all your code? I can't see anything that actually calls your VBS function. If you want it to happen when you click the Submit button, try changing that to a standard button which calls your VBS function.
So <input type="submit" value="Submit">
becomes <input type="button" value="Submit" onclick="VerifyData()">
Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validating Input from a Datasheet using VBA digby_dog Access VBA 1 October 6th, 2008 10:35 AM
DateTimePicker validating fongklem VS.NET 2002/2003 0 July 20th, 2005 09:17 AM
Validating XML sunilyenpure XML 3 July 13th, 2004 12:11 AM
validating user input hosefo81 Javascript How-To 12 March 3rd, 2004 09:32 AM
Validating user input stu9820 VB.NET 2002/2003 Basics 2 January 15th, 2004 12:51 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.