Click here to Skip to main content
15,917,174 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I'm using jQuery datePicker in a mobile application. I m facing one problem while using it. when i click on any day of chosen month and year, instead of chosing that day, the focus goes on button under the calender and that button is actually clicked.
What could be problem?

Thanks In advance
Posted

1 solution

hi

here is the sample date picker code
JavaScript
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>Date Picker</title>
 <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

   
	<script>
	$(function() {
		$( "#datepicker" ).datepicker({
		    dateFormat: "DD ,  mm/dd/yy",
			showOn: "button",
			buttonImage: "calendar.gif",
			buttonImageOnly: true
		});
	});

	function dt(ss){
//$( "#datepicker" ).change();
	var array =ss.split(',');
	alert(array[1]);
	
	}
	</script>
 </head>

 <body>
  <input type="text" id="datepicker" onchange="dt(this.value);"/>
 </body>
</html>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900