Jquery error on checkboxes with Dateinput plugin (jquery tools)
Hello,
I'm using following jquery code to create date inputbox whenever user click on checkbox.. First time click is always works fine but second or other clicks makes nothing, shows inputbox but whenever I click on inputbox it doesn't show the date..
- <script type="text/javascript">
jQuery(document).ready(function()
{
jQuery(":checkbox").click(function()
{
isChecked = jQuery(this).is(":checked");
thisValue = jQuery(this).val();
thisId = thisValue.split(" ");
spanId = thisId[0];
newInputBox = \'<p><input type="date" name="\'+spanId+\'" value="--kies een datum--" min="2011-01-13" max="2011-06-30"></p>\';
if(isChecked)
{
jQuery(newInputBox).appendTo("#"+spanId);
jQuery(":date").dateinput({
format: "dddd dd, mmmm yyyy", selectors: true,speed: "fast", firstDay: 1
});
}
else
{
jQuery("#"+spanId+" p").remove();
}
});
}); </script>
Screenshoots:
Image1: I clicked on first checkbox and input date works fine!!

Image2: I click on second checkbox, nothing happens!

Note: Those inputbox comes whenever I click on checkbox.