ChaosKnight Posted January 7, 2010 Share Posted January 7, 2010 Hi, I'm an Ajax noob and I don't know how it works yet, in the webpage that I'm busy with there are 4 select dropdowns, the first is for countries, second for provinces, third for towns and the last is for the hotels that match all previous criteria... The province should only display if the country global var is 'southafrica', and the dropdowns should auto-generate relative content from the database, I tried jQuery solutions but none that I found does this very specific task, the database will soon have thousands of entries so it should be as dynamic as possible Please help I tried this function but it did absolutely nothing: function getProvince(country) { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="getprovince.php"; url=url+"?country="+country; xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } And this was how I called it: <select id='countrySelect' name='country' onchange='getProvince(this.value);'> Can you please also guide me in the right direction for all the other select dropdowns? Thanks a lot! Quote Link to comment Share on other sites More sharing options...
dhvani Posted January 9, 2010 Share Posted January 9, 2010 Hi , You are missing some minor but important things . I can say here but i recommend you to find the ajax code on http://www.w3schools.com/ajax/default.asp or related tutorial. They will teach you from base. So you get clear idea on how to use ajax ? Its not hard but tricky. Try out your self if dont get ready to help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.