Hello i am using a simple calendar date picker in which when u click a date is displayed in an input field.
Using a javascript i am trying to retrieve data from a second page using this value but probably i am doing something wrong.
1st page:
[CODE] <script type=”text/javascript”>
function showCustomer(str)
{
if (str==””)
{
document.getElementById(“txtHint”).innerHTML=””;
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById(“txtHint”).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open(“GET”,”check6.asp?q=”+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<form>
Check in:
<input onchange=”showCustomer(this.value)” size=”22″ id=”f_date1″ /><button id=”f_btn1″>…</button>
<script type=”text/javascript”>//<![CDATA[
var cal = Calendar.setup({
onSelect: function(cal) { cal.hide() },
showTime: true
});
cal.manageFields(“f_btn1”, “f_date1”, “%Y-%m-%d”);
//]]></script>
</form>
<br />
<div id=”txtHint”>here…</div>
</body>
</html>
and in second one i am trying to get date like this:
[CODE]
sql_cmd.CommandText = “SELECT dbo.rooms.id, type, image, price,details FROM dbo.rooms, dbo.transactions WHERE dbo.rooms.id=dbo.transactions.roomid and ‘” & request.querystring(“q”) & “‘ not between checkin and checkout”