Jump to content

Aviway

Members
  • Posts

    37
  • Joined

  • Last visited

About Aviway

  • Birthday 05/27/1982

Profile Information

  • Location
    Israel

Aviway's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Sorry about the spam, but can someone help me?
  2. I'm sorry' but can you explain to me with code, becouse I dont know how to do it!
  3. function change_city(area_id){document.getElementById('city_loader').style.display='block';var xmlhttp; 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) { var result = xmlhttp.responseText; if (result) document.getElementById('city_loader').style.display='none'; document.getElementById('error_log').innerHTML='PROBLAM!'; }}xmlhttp.open("GET","pages/update/change_city_by_area.php?area_id="+encodeURIComponent(area_id),true);xmlhttp.send(null);} This is the function that call with "onclick" event. My problam is how to include the array that I'm returned from "change_city_by_area.php", inside the other SELECT TAG(city). I use this ajax code for a lot of things but i never used it to get response with array.
  4. Hello,I need help writing a code in AJAX. I have a form where you had to choose an area in the country,and after selecting the regionin the country,another SELECT tag will only see the cities that are in the selected area.The PHP\HTML code: <select id="area" name="area"><?phpforeach ($get_all_area as $key => $val){ echo '<option onclick="change_city('.$val['area_id'].')" value="'.$val['area_id'].'">'.$val['area_name'].'</option>';}?></select> ]<select id="city" name="city"><!-- All cities are in the selected area --></select>
×
×
  • Create New...