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

clear DatePicker error class

2 Answers 127 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Ashraf
Top achievements
Rank 2
Ashraf asked on 16 Nov 2012, 06:10 PM
hi, kindly help me ,i have 2 datepickers and set min date and max date ,it works fine ,
now when one of them make error ex. out of range then the date input take the error style ,that's great 
but when clear the the dates by clicking a clear button  the error style still appear ,
if i removed it by jquery ,it's appear again on mouse over event ,
how to clear date picker event it takes error style ?
i used the following function and it's work fine but with IE the popup calender still appear .why ?????
 //clear Add Holding Event Inputs
                function fnClearHoldingEventInputs(sender, args) {
                    
                    rdpEventStartDate.set_maxDate(maxDate);
                    rdpEventEndDate.set_minDate(minDate);
                    rdpEventStartDate.clear();
                    rdpEventStartDate.get_dateInput().clear();
                    rdpEventEndDate.clear();
                    rdpEventEndDate.get_dateInput().clear();
                    $('.riTextBox').val('');
                    //to remove error class from raddatepicker UI bug
                    $('.riError').removeClass('riError');
                    rdpEventStartDate.set_showPopupOnFocus(false);
                    rdpEventEndDate.set_showPopupOnFocus(false);
                    rdpEventStartDate.get_dateInput().focus();
                    rdpEventEndDate.get_dateInput().focus();
                    rdpEventStartDate.hidePopup();
                    rdpEventEndDate.hidePopup();
                    rdpEventStartDate.set_showPopupOnFocus(true);
                    rdpEventEndDate.set_showPopupOnFocus(true);
}

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 Nov 2012, 04:58 AM
Hi,

I suppose you want to hide the invalid icon. Here is the sample code.
JS:
var pkr = $find("<%= RadDatePicker1.ClientID %>");
pkr.get_dateInput()._invalid = false;

Thanks,
Princy.
0
Ashraf
Top achievements
Rank 2
answered on 19 Nov 2012, 09:28 AM
solved here is the code 

    var rdpEventStartDate = $find("<%= RadDatePicker1.ClientID %>");

    var rdpEventEndDate = $find("<%= RadDatePicker2.ClientID %>");

 

    rdpEventStartDate.get_dateInput()._holdsValidValue = true;

    rdpEventStartDate.clear();

 

    rdpEventEndDate.get_dateInput()._holdsValidValue = true;

    rdpEventEndDate.clear();

Tags
Calendar
Asked by
Ashraf
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Ashraf
Top achievements
Rank 2
Share this question
or