Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
Comparing Dates in WebDateChooser
posted

Hi,

I have a webDateChooser in my aspx page and 2 text boxes below it. When I select a date through the DateChooser drop down, I want to check if the selected date in less than Sep-30-2015. If this condition is met, then the Text box A should be enabled else if the Date is greater than Oct-01-2015 then the Text Box B should be enabled.

I am trying to write the below JavaScript on the AfterCloseUp event (please correct me If I am wrong here).

Any urgent help is much appreciated. Thanks in advance !

function CalendarDateOfServiceNew_AfterCloseUp(oDateChooser, dropDownPanel, oEvent) {

var date = oDateChooser.getValue();

alert(date);

if (date <= '09/30/2015') {

alert('Text Box A Enableed');

document.getElementById('<%=TextBoxA%>').enabled = true;

}

else {

alert('Text Box B Enableed');

document.getElementById('<%=TextBoxB%>').enabled = true;

}

}

Parents Reply Children