Reputation: 4520
I use a jQuery DateTimePicker in many places in my web app. It works fine everywhere exept in one place where the calendar just won't pop up. Here's the source code of the page (view in Chrome).
<script>
$('#example9').datetimepicker({ timeFormat: 'h:mm', stepMinute: 5, dateFormat: 'yy-mm-dd'
</script>
<div>
<input type="text" name="example9" id="example9" value="2012-10-16 15:00" />
</div>
As you can see, I've reduced the code to the simplest and added an event listener. Nothing is triggered and nothing happens whenever I click the input.
Any clue?
Upvotes: 0
Views: 109
Reputation: 195962
Make sure
script
code after the div
element, or use $(document).ready(function(){/*your-code*/});
id
is unique in the html or it will fail.Upvotes: 1
Reputation: 12805
Why would you do it that way? Instead of calling the datepicker on each specific input based on ID, just create an HTML class that all datepicker inputs will have. Then in your _Layout, or other JavaScript file that always gets called, turn everything with that class into a DatePicker.
Upvotes: 1
Reputation: 55740
You are doing this
.data("events")
I do not see a data-events attribute for the textbox
Upvotes: 0