Validations for TIME

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need user to input time in my specified time:

From Time hh:mm:AM/PM To Time : hh:mm:AM/PM

But both are free text

Any clues, ( other than suggesting me to change free text to dropdowns)
 
Try to create a Date object from the user input:

dateObject = new Date (myTextBox.value);

If the call sets datObject to NaN, the string is not a valid time.

Eliyahu
 
Any clues, ( other than suggesting me to change free text to dropdowns)

This is akin to asking if there is any other way to stop a car than applying
the brakes. Yes, there are other ways. There are no other GOOD ways.

The purpose of interface elements like drop-downs, check boxes, and radio
buttons is to prevent user input error. Humans are incredibly unreliable,
and often misspell there own names (yes, the misspelling was intentional).
It is best to leave the exacting stuff to computers, which lack creativity
but are incredibly reliable at repeating exactly what they've been told.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
Back
Top