Visual Programming

  Visual Basic Exercise

Validating User Input 2

Specific Length And Whole Number Textbox
Date Textbox


Specific Length And Whole Number Textbox

~~Exercise 1~~

This type of textbox will allow a whole number input provided a specific number of digits have been entered. This is useful where you require input of a specific length - an ID field for example where you want a whole number of a specific length - e.g. 1103245

In the textbox below I have decided that you have to enter a whole number of exactly 7 digits long. It should reject any other input.

Type some input into the textbox. Choose if you think it will be considered valid or invalid for a Specific Length Whole Number Textbox. Then click Test My Input to see if you are correct.

 
 

   
 

~~Exercise 2~~

For each input listed below, choose if you think it is valid or invalid for the Specific Length Whole Number Textbox above.
Then click Submit to check all your answers.

  Input Result (choose)
  abcdefg


     
  #12@111    
     
  12.34567
     
  1234567
     
  0000001
   

 

Date Textbox

~~Exercise 1~~

This type of textbox should allow date of various types.

Type some input into the textbox. Choose if you think it will be considered valid or invalid for a Date Textbox . Then click Test My Input to see if you are correct.

 
 

   
 
   

~~Exercise 2~~

For each input listed below, choose if you think it is valid or invalid for the Date Textbox above. Then click Submit to check all your answers.

  Input Result (choose)
 

10-03-04


     
 

10/03/04

   
     
  10-03-2004
     
  10/03/2004
     
 

10 March 2004

   

 

Question - Are the dates you entered into the textbox in English or American date format?

Question - If you type the date 10:03:04 into the textbox above will it accept it. What if you type the same date 10:03:04 into Visual Basic - will it accept it?

 


Fini
 

 

 

   

  Unit Information

Assessment

Syllabus

Scheme of Work

Notes &Tutorials

Assignments

Quizzes

Books & Things

Links

ADR 2002