function getVars() { alert(document.getElementById('state').value); } // Roshan's Ajax dropdown code with php // This notice must stay intact for legal use // Copyright reserved to Roshan Bhattarai - nepaliboy007@yahoo.com // If you have any problem contact me at http://roshanbh.com.np function getXMLHTTP() { //fuction to return the xml http object var xmlhttp=false; try{ xmlhttp=new XMLHttpRequest(); } catch(e) { try{ xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){ try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e1){ xmlhttp=false; } } } return xmlhttp; } function getState(countryId) { var strURL="TECH_SEARCH_FORM/findState.php?country="+countryId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('stateCityJobsDiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } document.getElementById("imgLoading").style.display="none"; document.getElementById("edit-submit").disabled=false; if (countryId == '' || countryId == '1') { document.getElementById('state').disabled=true; } document.getElementById('city').disabled=true; } else { document.getElementById("imgLoading").style.display="inline"; document.getElementById("edit-submit").disabled=true; } } req.open("GET", strURL, true); req.send(null); } } function getCity(countryId,stateId) { var strURL="TECH_SEARCH_FORM/findCity.php?country="+countryId+"&state="+stateId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('cityJobsDiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } document.getElementById("imgLoading").style.display="none"; document.getElementById("edit-submit").disabled=false; } else { document.getElementById("imgLoading").style.display="inline"; document.getElementById("edit-submit").disabled=true; } } req.open("GET", strURL, true); req.send(null); } } function getJobs(countryId,stateId,cityId) { var strURL="TECH_SEARCH_FORM/findJobs.php?country="+countryId+"&state="+stateId+"&city="+cityId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('JobsDiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } document.getElementById("imgLoading").style.display="none"; document.getElementById("edit-submit").disabled=false; } else { document.getElementById("imgLoading").style.display="inline"; document.getElementById("edit-submit").disabled=true; } } req.open("GET", strURL, true); req.send(null); } } function eventGetState(countryId) { var myList = window.document.form1.jobs; for(var count = myList.options.length - 1; count >= 0; count--) { myList.options[count] = null; } var myList = window.document.form1.city; for(var count = myList.options.length - 1; count >= 0; count--) { myList.options[count] = null; } var myList = window.document.form1.state; for(var count = myList.options.length - 1; count >= 0; count--) { myList.options[count] = null; } var strURL="EVENT_SEARCH_FORM/findState.php?country="+countryId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('statediv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } document.getElementById("imgLoading").style.display="none"; } else { document.getElementById("imgLoading").style.display="inline"; } } req.open("GET", strURL, true); req.send(null); } } function eventGetCity(countryId,stateId) { var myList = window.document.form1.jobs; for(var count = myList.options.length - 1; count >= 0; count--) { myList.options[count] = null; } var strURL="REG_SEARCH_FORM/findCity.php?country="+countryId+"&state="+stateId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { document.getElementById("imgLoading").style.display="none"; // only if "OK" if (req.status == 200) { document.getElementById('citydiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } else { document.getElementById("imgLoading").style.display="inline"; } } req.open("GET", strURL, true); req.send(null); } } function eventGetVenue(countryId,stateId,cityId) { var strURL="REG_SEARCH_FORM/findJobs.php?country="+countryId+"&state="+stateId+"&city="+cityId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { document.getElementById("imgLoading").style.display="none"; // only if "OK" if (req.status == 200) { document.getElementById('jobsdiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } else { document.getElementById("imgLoading").style.display="inline"; } } req.open("GET", strURL, true); req.send(null); } } function reggetState(countryId) { var strURL="REG_SEARCH_FORM/findState.php?country="+countryId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status == 200) { document.getElementById('statediv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } document.getElementById("imgLoading").style.display="none"; } else { document.getElementById("imgLoading").style.display="inline"; } } req.open("GET", strURL, true); req.send(null); } } function reggetCity(countryId,stateId) { var strURL="REG_SEARCH_FORM/findCity.php?country="+countryId+"&state="+stateId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { document.getElementById("imgLoading").style.display="none"; // only if "OK" if (req.status == 200) { document.getElementById('citydiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } else { document.getElementById("imgLoading").style.display="inline"; } } req.open("GET", strURL, true); req.send(null); } } function contactgetState(countryId) { var strURL="CEDIT_SEARCH_FORM/findState.php?country="+countryId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status == 200) { document.getElementById('statediv').innerHTML=req.responseText; contactgetCity(document.getElementById('Country').value,document.getElementById('State').value); } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } document.getElementById("imgLoading").style.display="none"; } else { document.getElementById("imgLoading").style.display="inline"; } } req.open("GET", strURL, true); req.send(null); } } function contactgetCity(countryId,stateId) { var strURL="CEDIT_SEARCH_FORM/findCity.php?country="+countryId+"&state="+stateId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { document.getElementById("imgLoading").style.display="none"; // only if "OK" if (req.status == 200) { // document.getElementById('citydiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } else { document.getElementById("imgLoading").style.display="inline"; } } req.open("GET", strURL, true); req.send(null); } }