Hello,
I am currently working on a function that will allow the user to search for an event by date and category.
I've been using the w3schools exercise as an example but i wish to pass 2 pieces of data instead of one and am not sure how to do so.
I'm sure similar posts have been raised before and i apologise if this type of question has already been answered but i could't find it in the forum index.
<FORM name="myForm">
<INPUT type="text" readonly name="MyDate2" value="Click for Calender" onClick="toggleCalendar('MyDate2')"size="15">
Select a Classification:
<select name="Classification2">
<option value="Accountants">Accountants</option>
<option value="Aerial Services">Aerial Services</option>
</select>
<button name="Search" value="radio1" onClick="showupdate(document.myForm.MyDate2.value);">Search Promotions</button>
<br>
</form>
------------------------------------------------------------------
var xmlHttp
function showupdate(str)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="getupdatePromo.php"
url=url+"?q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("txtupdate").innerHTML=xmlHttp.responseText
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
---------------------------------------------------------------------
i won't bother including the sql page as i don't think that is the problem.
I've tried various combinations such as:
var url="getupdatePromo.php"
url=url+"?q="+str+"?q2="+str2
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
and such like but it just feels like i'm going around in circles.
Any help would be much appreciated. Even just point me in the direction of a good article or tutorial, i've been banging my head against it for 2 days so i'm very willing to take a few hours to go through a tutorial
many thanks
Tom.