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
How can I show the date picker on input and icon click #704
Comments
I've solved this doing the following:
|
In case anybody else stumbles on this question, this is how I solved it with jQuery: $('.open-datetimepicker').click(function(event){
event.preventDefault();
$('#datetimepicker').click();
}); Your HTML might look similar to this: <div class="input-group">
<input type="text" id="datetimepicker" class="form-control" name="date">
<label class="input-group-addon btn" for="date">
<span class="fa fa-calendar open-datetimepicker"></span>
</label>
</div> |
This works for us in both Chrome and Safari. Thanks! |
You can easily do this:
Also a new feature in the dev branch, you can press the down arrow key while focused on the input box to show the picker |
perhaps binding focus is better than click? |
Thanks @brubie!!! that works |
the current version allows |
Thanks @brubie your solution safe me a headache and hours googling |
as @Eonasdan said just use:
and it works like a charm |
Thanks @brubie . |
I have used one main wrapper in below solution to use where we can open the date picker on text box as well as glyphicon-calendar ...
|
@kingjerod. Thanks.
|
Thanks @brubie |
Add grammatically correct "No files selected" message
Thanks @rroxysam you're a life saver 👍 |
Use data-provide attribute for input-group div. <div class="input-group date" data-provide="datepicker">
<input type="text">
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div> |
what if i have an icon, and when i pick the date, the value of a span change? not input? |
Right now it works just by clicking the icon but I would also like it to show when a user clicks the input flied
The text was updated successfully, but these errors were encountered: