Linked Questions

Popular Questions


I'm having a problem getting the calendar to show up on a click. Ti should be a really simple thing, but I'm having a really hard time with it.

These are my included libraries:

<link rel="stylesheet" href="css/jquery.datepick.css" id="theme">
<script src="Scripts/jquery.min.js"></script>
<script src="Scripts/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="Scripts/jquery.plugin.min.js"></script> 
<script type="text/javascript" src="Scripts/jquery.datepick.min.js"></script>

Here's the function I set up:

> <script> $(function() {    $('#Dater').datepick(); }); </script>

And here's the code that creates the input box:

var newRow   = tableRef.insertRow(tableRef.rows.length);
var cell1 = newRow.insertCell(0);

cell1.innerHTML = "<input type='text' Name='Dater' id='Dater'>";

The input box appears on the page, but when you click in it, there isn't any calendar that drops down.

I'm sure it has to do with the input box being drawn dynamically, because I have a standard HTML input box that works fine on the same page, but I can't figure out what's wrong.

Here is how the working input box is coded:


<input type="text" id="Period" Name="Period" style="position:relative;left:247px;">


> $('#Period').datepick();

Any help would be greatly appreciated. Thanks!

Edited to add: I just realized that if I use the dropdown on the first item (the one that's hard-coded HTML) the second one works, but if I don't click in the first item, the second one doesn't activate.

Related Questions