473,400 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

Form validation rules

84
I have a form that has several text boxes where the operator can enter data. I want to place some validation rules around what the operator can enter.

In one box I want the number to be at least 3 digits (001 - 999). Every time I put in a number with leading zeros in the validation rule they get stripped off and the system will accept a single number. I tried ??0 and 000, like 000, like ???. Is there a validation rule will require 3 digit number and accept leading zeros?

In another box I have the operator entering dates. Is there any validation rule that will ensure the date entered is a valid date?
Apr 5 '07 #1
7 3409
Rabbit
12,516 Expert Mod 8TB
You have to make the field text to have leading zeroes.

If the field is Date/Time then you don't need a validation rule. They can't enter anything that's not a date.
Apr 5 '07 #2
sesling
84
You have to make the field text to have leading zeroes.

If the field is Date/Time then you don't need a validation rule. They can't enter anything that's not a date.
Not sure how to do the first one "make the field text to have leading zeroes". how and where would this be entered?

On the Date/time, how would you require the date be in a yyyymmdd format? That date format is not one of the selections for date/time.
Apr 5 '07 #3
Rabbit
12,516 Expert Mod 8TB
Not sure how to do the first one "make the field text to have leading zeroes". how and where would this be entered?

On the Date/time, how would you require the date be in a yyyymmdd format? That date format is not one of the selections for date/time.
If you go into design view for the table and select the field and change the data type to text.

Why do you need date in that format?
Apr 5 '07 #4
sesling
84
If you go into design view for the table and select the field and change the data type to text.

Why do you need date in that format?

On the first item, I am not entering the data into a table but passing it to a command button as criteria.

The date needs to be formated yyyymmdd when its passed as criteria to the program that will use it.
Apr 5 '07 #5
Rabbit
12,516 Expert Mod 8TB
On the first item, I am not entering the data into a table but passing it to a command button as criteria.

The date needs to be formated yyyymmdd when its passed as criteria to the program that will use it.
You can either use AAA as the input mask or do it in the After Update event to append leading zeroes. Either way you may want to check that it's actually a number.

Why not format it as a date and then format it back to yyyymmdd when you pass it to the program?
Apr 6 '07 #6
sesling
84
You can either use AAA as the input mask or do it in the After Update event to append leading zeroes. Either way you may want to check that it's actually a number.

Why not format it as a date and then format it back to yyyymmdd when you pass it to the program?
On the first issue I placed an Input Mask of 000 and this works. It requires 3 digits and accepts leading zeros.

I was able to get my boss to accept the different date entry to a more standard one of mm/dd/yyyy. When I pass the value to the command line I format it to yyyymmdd. Thx for your help on this
Apr 9 '07 #7
Rabbit
12,516 Expert Mod 8TB
Not a problem, good luck.
Apr 10 '07 #8

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

Similar topics

21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
11
by: r0adhog | last post by:
First off wanted to that all that replied to my previous questions, you were much help. Had a couple of general questions. Why has everyone suggested not using VB Script on the Client Side? ...
1
by: Mike | last post by:
Note: My XML experience to date has (unfortunately) been limited to reading and thinking, rather than implementation. Anyway, I am in the process of trying to figure out the most efficient way...
2
by: wumingshi | last post by:
Hi, When validating an XML instance, sometimes the schema is not enough to expression the validation rules. Additional validation rules may be expressed in an application-specific way. For...
2
by: Nick Bell | last post by:
I have a general form validation question. I know very little about javascript, a little more about PHP. Using yav (http://yav.sourceforge.net): <form method="POST" name=edit onsubmit="return...
67
by: Scott Meyers | last post by:
I have a web site that, due to maintenance by several people, some of whom are fairly clueless about HTML and CSS, etc. (notably me), has gotten to the point where I'm pretty sure it's suffering...
1
by: angus | last post by:
Dear All, how to try-catch "A potentially dangerous Request.Form value was detected from the client (txtUserName="<asdf")." this exception? i've set the debugger in the Page_InIt function,...
10
by: gweasel | last post by:
What is the best way to apply a Validation Rule - or rather, where is the best place to put it? Is there an advantage to putting it on the field in the table vs setting the validation rule on the...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.