R
Ramu Ravi
Dear All,
I am facing another problem. I am trying to validate hours. In my case, i
want the hours to be represented in 12hour format. What i mean is the
single digit hours should be preceeded with 0.(01,02,03...).
I am using the following expression in a function to validate for
numbers(hours).
function testnumber()
{
var src = event.srcElement;
var num=parseInt(TxtValue); ' TxtValue has the value of hours.
if (!(/^\d{2}$/.test(num))) {
alert (' Invalid Time')
return false
}
it gives me an error for all hours, i.e., number apart from 10,11,12.
I am explicitly adding 0 to represent the single digit hours in the textbox.
My function is not recognising the value even after converting to integer
using parseInt.
Or is there any other way to validate the hour and preceeded with 0 provided
if the hour is in single digit.
TIA
Ravi
(e-mail address removed)
I am facing another problem. I am trying to validate hours. In my case, i
want the hours to be represented in 12hour format. What i mean is the
single digit hours should be preceeded with 0.(01,02,03...).
I am using the following expression in a function to validate for
numbers(hours).
function testnumber()
{
var src = event.srcElement;
var num=parseInt(TxtValue); ' TxtValue has the value of hours.
if (!(/^\d{2}$/.test(num))) {
alert (' Invalid Time')
return false
}
it gives me an error for all hours, i.e., number apart from 10,11,12.
I am explicitly adding 0 to represent the single digit hours in the textbox.
My function is not recognising the value even after converting to integer
using parseInt.
Or is there any other way to validate the hour and preceeded with 0 provided
if the hour is in single digit.
TIA
Ravi
(e-mail address removed)