Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Input > Check if RadDateInput text is valid in Javascript
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Answered Check if RadDateInput text is valid in Javascript

Feed from this thread
  • Richard M Intermediate avatar

    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 avatar

    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.

  • Richard M Intermediate avatar

    Posted on Dec 29, 2010 (permalink)

    That sounds good, thanks!

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Input > Check if RadDateInput text is valid in Javascript