View Single Post
Old 08-27-2012, 07:22 PM   PM User | #1
jason_kelly
Regular Coder

 
Join Date: Sep 2011
Posts: 140
Thanks: 88
Thanked 0 Times in 0 Posts
jason_kelly is an unknown quantity at this point
Jquery UI Datepicker doesn't show again when link is clicked

Hello,

I need your help.

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?

Code:
<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>
Thanks for all your help in advance,

Cheers,

Jay
jason_kelly is offline   Reply With Quote