-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datetimepicker / Datepicker / Timepicker without Input Field #1327
Comments
Even if it isn't possible, it would be great if somebody could tell me. Although its certainly going to be rubbish compared to Eonasdan DateTimePicker I guess I would have to start looking for another solution then. :( |
flattery is a great way to start :) Presently, there's not really a way to use the picker without the input field. You can do something like this: http://jsfiddle.net/Eonasdan/516zsh7b/ In Version 5 ( #841) I'm hoping to uncouple the picker from the input field more so that people can use it like that. |
Splendid! Thank you for your quick reply. The fiddle is already a great start. I hope you don't mind me asking if its possible to obtain the set date? I assume its still stored somewhere in the hidden input field? Also I toyed around a bit (http://jsfiddle.net/fbosler/516zsh7b/2/) and found that the toggling of the datetimepicker wouldn't work after changing the innerHTML of the button. Is there a good way around that? Again, I really appreciate your work here! |
all the options are available via I don't know why changing the innerHtml would make a difference. You can "Update" or "Fork" the fiddler with your changes if you want. |
Sweet, didn't know that. Please find an updated fiddle that shows (sort of) what I want the picker to do. http://jsfiddle.net/fbosler/516zsh7b/3/ |
this works. http://jsfiddle.net/Eonasdan/516zsh7b/4/ I would highly recommend listening to the change event ( |
This is fantastic! Thank you so much. I updated the fiddle to reflect your suggestion. However, now it needs two clicks to open the DateTimePicker after the first time. Am I missing something here? Update: Thanks again for your help! |
hmmm looks like setting the html in the change event closes the picker, which may not be ideal for your situation. I'm not sure right off how to get around that. A work around would be to have a span beside the button that held the value, set the span on change and leave the button as the icon. also, if you only want the date you can adjust the |
Hi Eonasdan! As seen in http://jsfiddle.net/fbosler/516zsh7b/6/ I got the Date part working. However, the time part is still a bit buggy, any idea why? It says widget.find() is not a function. Please find attached the newest widget. Thanks again! |
Hey! Any idea why? |
@marianacapelo Looks like using the button as the widget parent does not work on IE11 and Firefox (Chrome works fine). My current workaround is to use a parent |
Hi @Eonasdan/Anyone reading this , Many thanks for this great plugin. |
If anyone has the same issue: The solution posted above don't shut on outside click anymore, because a hidden input can not be focused. I've implemented a quick'n'dirty work around by using the |
I am fairly new to Github so please forgive me - should I be in violation of the etiquette with my question. This isn't really an issue but more of a problem I am having. I am trying to use the Datetimepicker (more precisely a Datepicker and a Timepicker) but without an input field.
I want a button with a calendar icon on it which opens the datepicker on click, after picking a date the button should change from a calendar icon to the chosen date.
Is there a way to achieve the desired result with Eonasdan Bootstrap-datetimepicker?
Thank you very much and keep up the good work!
The text was updated successfully, but these errors were encountered: