jQuery Datepicker icon showing below the input box instead of on the right

Tim T

I just started using jQuery Datepicker and have a problem. I got the calendar icon showing but it's being shown below the input box instead of to the right. Since the calendar icon is called by the jQuery code, what option do I use to get it to display inline? Here's my relevant code. Thanks.

<script>
$(function() {
    $( "#datepicker" ).datepicker({
        showOn: "button",
        buttonImage: "calendar_icon.gif",
        buttonImageOnly: true,
        buttonText: "Open calendar"
    });
});
</script>
Date: <input type="text" id="datepicker" />
rrtx2000

Since you don't mention anything about your css, I'm guessing that's where your problem is. You need to add a ui-datepicker-trigger class to your css file. This will automatically get assigned by the function so you don't need to change the input to include class="ui-datepicker-trigger". I just copy and pasted what I'm using in one of my css files. The part you need is the display: inline part but I figure you might get some use out of the whole thing.

.ui-datepicker-trigger {
    display: inline;
    padding:0px;
    padding-left:3px;
    vertical-align:baseline;
    position:relative;
}

To expand on this a bit further, this would be necessary if you have some generic css behavior causing it to show up below the input box.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

jQuery Datepicker icon showing below the input box instead of on the right

From Dev

JQuery Datepicker: put week number in the input box instead of selected day

From Dev

Rails 4 & JQuery UI datepicker - icon not showing up

From Dev

Force jQuery UI Datepicker to display below input field

From Dev

Force jQuery UI Datepicker to display below input field

From Dev

Trigger jQuery datepicker element on both input click and add-on icon

From Dev

Zebra datepicker icon not showing up

From Dev

Overlay icon on input box

From Dev

input box datepicker not working in all pages of jQuery DataTables

From Dev

Jquery datepicker icon not working

From Dev

Make datepicker appear below input

From Dev

DatePicker in jQuery Not Showing Calendar

From Dev

JQuery datepicker not showing in JSP

From Dev

jquery datepicker not showing calender

From Dev

How to align datepicker icon appearing below the datepicker textbox properly?

From Dev

Centering input box and icon button

From Dev

jQuery showing comment box

From Dev

Input box right next to label

From Dev

Make icon appear on top right of the box

From Dev

set right dateformat with jquery datepicker

From Dev

jQuery Dialog Box not working with Datepicker

From Dev

Suggestion box not showing for nearest input

From Dev

CSS: Images not showing for JQuery datepicker

From Dev

JQuery datepicker not showing properly with css

From Dev

JQUERY UI DatePicker Calendar not showing

From Dev

jQuery datepicker not showing in my App

From Dev

Showing suggestion box when typing in input box

From Dev

Datepicker icon does not appear next to input textbox

From Dev

Why showing path instead of icon in table cell

Related Related

HotTag

Archive