Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Validation - need to add preceding zero's 1

Status
Not open for further replies.

redbase

Technical User
Nov 21, 2002
21
GB
Hi

I have an asp form that asks a user to put in 2 strings of reference codes to look up a record. This has been done using a submit form with input text boxes.

The reference strings each consist of 8 numerical cahracters. Some of the strings contain preceeding zero's but users are just used to not having to add them with the current system in use.

Example:

for "00012345" a user will just enter "12345" and the preceeding zero's will automatically be added.

What is the best (or any) way to do this?

Many thanks

 
On the asp side....

inCode1 = request("code1")

do while len(inCode1)<8
inCode1 = &quot;0&quot; & inCode1
loop

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top