how to add datepicker in ajax response result

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
khalidhabib.cs
Forum Newbie
Posts: 14
Joined: Tue Jul 17, 2012 1:35 am

how to add datepicker in ajax response result

Post by khalidhabib.cs »

Code: Select all

<link href="jquery-ui-1.8.23.custom.css" rel="stylesheet" type="text/css" />
<script  src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.23.custom.min.js"></script>
<script>
$('#date').datepicker();
</script>
this is function 
function edit_emp(id){
	//alert('work on edit user');
	 			var xmlhttp2;
			 if(window.XMLHttpRequest){
				 // code for IE7+, Firefox, Chrome, Opera, Safari
				xmlhttp2=new XMLHttpRequest();
				}
			else {
				// code for IE6, IE5
				xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP");
					  }
				xmlhttp2.onreadystatechange=function(){
							
			if (xmlhttp2.readyState==4 && xmlhttp2.status==200){
				
				document.getElementById("fields").innerHTML=xmlhttp2.responseText;
						}
					}
				 //alert(id);
				xmlhttp2.open("GET","editEmp.php?empID="+id,true);
				xmlhttp2.send();
				$('#fields').fadeIn('slow');
	}
response dive 
<div id="fields">
 </div>
here is page edit_emp.php
<input type="text" name="dob" id="dob" class="dob" />
I want show datepicker in this txt box
please help
Last edited by Benjamin on Wed Sep 19, 2012 2:14 pm, edited 1 time in total.
Reason: Added [syntax=php||htm||css||javascript||sql||etc] - Please use [syntax] tags when posting code in the forums! Thanks.
Post Reply