Chrome type=“date” and jquery ui date picker clashing

前端 未结 6 733
再見小時候
再見小時候 2020-12-15 08:06

I have a input box having type=\"date\", everything works fine in IE but in latest version of Chrome it comes with a spinner, Down arrow and with a placeholder of mm/dd/yyyy

6条回答
  •  独厮守ぢ
    2020-12-15 08:24

    You can just remove the type of "date" and switch it to "text" like in the following fiddle: best of luck jsfiddle

    removeDefaultDate = function(){
        $('input[type=date]').each(function(){
            this.type="text";
        });
        $('input[type=date]').datepicker({dateFormat: 'yy-mm-dd'});
    }
    

提交回复
热议问题