ruby on rails - How to implement bootstrap datepicker with text_field? -


i want use bootstrap datepicker text_field inside form_for. how should rewrite

 <%= f.text_field :some_date %> 

line store selected date in some_date field?

date time picker support input type direct integration. rails text_field create text area. can't directly.

you can either integrate datetimepicker onclick or mousedown event. can div/span.

if want need override datetimepicker code check supported html elements.

code below should change : link here

attachdatepickerelementevents = function () {     input.on({         'change': change,         'blur': options.debug ? '' : hide,         'keydown': keydown,         'keyup': keyup,         'focus': options.allowinputtoggle ? show : ''     });      if (element.is('input')) {         input.on({             'focus': show         });     } else if (component) {         component.on('click', toggle);         component.on('mousedown', false);     } }, 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -