Posted
on Dec 28, 2010
(permalink)
When I click on an asp button, I want to run a javascript function that checks if my RadDateInput1 is valid or not. If the value that the user enters a the wrong format, then RadDateInput1.validated = false; return false; If the value is in the correct format, then RadDateInput1.validated = true; return true;
Answer
Shinu
MVP
Posted
on Dec 29, 2010
(permalink)
Hello Richard,
Normally, you can check for whether the "get_selectedDate()" returns null or valid date; it returns null if there is no date selected or date is invalid.
An option to differentiate between the invalid date and nothing selected in date-input is, by using OnError client event. Use a global variable as a flag to set the value in OnError handler. Now check for the flag to know whether date is invalid or not. Also you need to reset the flag when selecting a date.
-Shinu.
Posted
on Dec 29, 2010
(permalink)
That sounds good, thanks!