clear DatePicker error class

3 posts, 0 answers
  1. Ashraf
    Ashraf avatar
    40 posts
    Member since:
    Aug 2012

    Posted 16 Nov 2012 Link to this post

    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. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 Nov 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ashraf
    Ashraf avatar
    40 posts
    Member since:
    Aug 2012

    Posted 19 Nov 2012 Link to this post

    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();

Back to Top