Tuesday, August 28, 2012

javascript – Jquery UI Datepicker doesn't show again when link is clicked

I seem to have this working except for the fact that once the link is clicked, the datepicker opens, then I select a date and all is good and well, then once I try to click the link again, the date picker does not open again.


What am I doing wrong?



<html>

<head>

<!-- LOAD JQUERY LIBRARY: -->
<link href=\"jq/jquery-ui.css\" type=\"text/css\" rel=\"stylesheet\" />
<script src=\"jq/jquery.min.js\" type=\"text/javascript\"> </script>
<script src=\"jq/jquery-ui.min.js\" type=\"text/javascript\"> </script>

<script type=\"text/javascript\">

function test() {

var datePickerValue = null;

$(\"#d1\").datepicker().datepicker(\"show\").change(function ()
{
$(\'#d1\').datepicker({onSelect: datePickerValue = $(this).val() }).hide();

alert(\"You picked: \" + datePickerValue);
});



}


</script>



</head>

<body>

<div id=\"d1\"></div>
<a href=\"javascript:test()\">test</a>

</body>

</html>






Rating: 5 out of 5 based on 3 ratings



The post javascript – Jquery UI Datepicker doesn't show again when link is clicked appeared first on Javascript ASK.






via Javascript ASK http://javascriptask.phpfogapp.com/javascript-jquery-ui-datepicker-doesnt-show-again-when-link-is-clicked.html

No comments:

Post a Comment