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
445
Use label instead of input in datepicker
posted

Hi all,

I want to replace input of datepicker by a label, just display: 15/4/2014 [c] with [c] is a calendar icon. Is there any simple way to implement it?

Thanks,

Ngan

Parents
No Data
Reply
  • 49378
    posted

    Hello Ngan,

    The current implementation of the igDatePicker does not allow changing the type of the input field, however by handling the keyDown event of the widget it is possible to cancel the event when the focus is on the input field, therefore preventing keyboard input:

                $("#datePicker").igDatePicker({
                    keydown: function (evt, ui) {
                        if (evt.originalEvent.target.id === "datePicker") {
                            //evt.preventDefault();
                        }
                    }
     
                });
     
    Hope this helps. Please feel free to contact me if you have any questions.

     

Children