473,574 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can I get my script to hold the correct info from the input box

4 New Member
How can I get my script keep the correct answers in the input box and have the person redo only the incorrect answers?

Expand|Select|Wrap|Line Numbers
  1. im MyString, MyArray, i, objRegEx, array, stransw1, strquit, Firstname, Lastname, Password, aMyString
  2. stransw1 = true
  3.  
  4. Do while stransw1 = true
  5.  
  6. MyString = Inputbox("please tell me your Firstname: Lastname: Password: PLEASE PLACE A COMMA BETWEEN EACH")
  7.  
  8.  
  9.  if Mystring = "" then 
  10.  strquit = msgbox ("Do you want to quit?", vbyesno)
  11.  if strquit = vbyes then
  12.  wscript.quit
  13.  end if
  14. end if
  15.  
  16.  MyArray = Split (MyString, ",")
  17.  
  18.  if UBound(MyArray) = 2 then
  19.  stransw1 = false
  20.  
  21.  Set RegEx = New RegExp                      'create regular expression.
  22. RegEx.pattern = "^([a-zA-Z]+)$"             'set pattern.
  23. Set Matches = RegEx.Execute(MyArray(0))     'execute the search
  24. if Matches.count = 0 then
  25. stransw1 = true
  26. Msgbox "First name can't contain special characters or numbers"
  27. end if
  28.  
  29. Set RegEx = New RegExp
  30. RegEx.Pattern = "^([a-zA-Z]+)$"
  31. Set Matches = RegEx.Execute(MyArray(1))
  32. if Matches.count = 0 then
  33. stransw1 = true
  34. Msgbox "Last name can't contain special characters or numbers"
  35. end if
  36.  
  37.  
  38. Set RegEx = New RegExp
  39. RegEx.Pattern = "[A-Z]" 
  40. Set Matches = RegEx.Execute(MyArray(2))
  41. if Matches.count = 0 then
  42. stransw1 = true
  43. Msgbox "Password must have Upper case letter"
  44. end if
  45.  
  46. Set RegEx = New RegExp
  47. RegEx.Pattern = "[a-z]"
Apr 5 '14 #1
0 878

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2120
by: Joe Randstein | last post by:
Hi! I need the best way to solve a problem, I'm a newbie. I have "login.php", a login script. That page first displays a login form with itself as target of a post-request to validate data when user presses the login-button (I can't change that setup). If the login is not correct I want to display the login form again and show an...
5
5332
by: Shabam | last post by:
I need to create a perl script that basically loads a web page, asks for a Username and stores it as "Username". Also, it takes the domain name of the site (that runs the script) and stores that in "Domain". Next it does a substition: http://www.anothersite.com/whatever.cgi?var1=Username&var2=Domain And forwards the user to that url.
17
7900
by: comp.lang.tcl | last post by:
The TCL command I am using will do a command-line action on a PHP script: set cannotRunPHP I have to do it this way as both the TCL script and the PHP script run as CLI. However, "info.php" requires user input to run; this causes the TCL script calling the PHP script to hose up and die. Is there a way I can do this so that the TCL...
2
2243
by: sophie_newbie | last post by:
Hi, I'm wondering if there is a way to get a python script to write text to an input box in a window of another program that is running? For example a text box in a web browser window? Thanks!
3
1557
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I need to toggle the text on an html input button in a .net web application. the name of the button is btn_hide and I do have an onclick function for it. <script language="javascript" type="text/javascript"> // <!CDATA]> </script> -- thanks, Paul G Software engineer.
7
4485
by: panteraboy | last post by:
Hi again byters. I developed an access 2003 database which contains various different computer, servers, printer etc specifications.(thanks for all the help) The system will be implemented using a touchscreen. The user/ customer will be able to view the different models but will have no previlegies for updating.I have created an invisible small...
6
4637
by: Robocop | last post by:
I have a simple little script that reads in postscript code, appends it, then writes it to a new postscript file. Everything worked fine a month ago, but after rearranging my directory tree a bit my script fails to find the base postscript file. The line in question is: for line in fileinput.input(): output.write(line)
1
1348
by: Rabiya | last post by:
hi, i want to have the perl script that can take input from any text file. i have the one bt its not doing the required job
5
2088
rush it
by: rush it | last post by:
I'm working on a water usage calculator for a client site. The water department superintendent of a small town wants residents to be able to enter the number of gallons of their swimming pool to find out how much more their water bill will be for that month. The user inputs the gallons, and that number is multiplied by a $2.61 water fee per 1000...
0
7808
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7732
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8063
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5626
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3742
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3754
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.