This is a migrated thread and some comments may be shown as answers.

isEmpty() bug

1 Answer 51 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jason Lee
Top achievements
Rank 1
Jason Lee asked on 01 Sep 2008, 01:02 PM
Dear Sir,

I use isEmpty (client-side script) to check is input box empty or not...
However, if I type a invalid value (therefore, input box is not empty anymore), the isEmpty still returns true...

              if(!dpDelivery1.isEmpty() && date1 == null)
              {
                    alert("Invalid Input");
                    return false;
              }


For my suggestion, Telerik could provide a isError function for validating input value.  That's be more easier.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 01 Sep 2008, 01:48 PM
Hi Jason,

The idea of the isEmpty() method is to check whether a valid date has been selected (parsed). That is why the method returns "true" if the value is invalid.

If you want to check for both valid and invalid values, please use

if (dpDelivery1.get_textBox().value == "")
{
      ........
}


All the best,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
Jason Lee
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or