JavaScript How to show results with AJAX show results in english,show results for lotto,show results

I have problem with AJAX and database. I don't know what I have now to do. So, I have this AJAX code:

<script>
function showCity(str) {
    if (str == "") {
        document.getElementById("txtHint").innerHTML = "";
        return;
    } else { 
        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","rozpiski.php?q="+str,true);
        xmlhttp.send();
    }
}
</script>

I want: When user select some option, the second select list shows value (after gets this values from database).

This is my code HTML:

<select name="country3" onchange="showCity(this.value)"> <option>Anglia</option><option selected='selected'>Austria</option><option>Belgia</option><option>Czechy</option><option>Dania</option><option>Estonia</option><option>Finlandia</option><option>Francja</option><option>Holandia</option><option>Islandia</option><option>Lichtenstein</option><option>Luxembourg</option><option>Niemcy</option><option>Norwegia</option><option>Polska</option><option>Szwajcaria</option><option>Szwecja</option><option>Słowacja</option><option>Słowenia</option><option>Wyspy Owcze</option><option>Węgry</option><option>Włochy</option><option>Łotwa</option><option>Anglia</option><option>Austria</option><option>Belgia</option><option>Czechy</option><option>Dania</option><option>Estonia</option><option>Finlandia</option><option>Francja</option><option>Holandia</option><option>Islandia</option><option>Lichtenstein</option><option>Luxembourg</option><option>Niemcy</option><option>Norwegia</option><option>Polska</option><option>Szwajcaria</option><option>Szwecja</option><option>Słowacja</option><option>Słowenia</option><option selected='selected'>Wyspy Owcze</option><option>Węgry</option><option>Włochy</option><option>Łotwa</option><option>Anglia</option><option>Austria</option><option>Belgia</option><option>Czechy</option><option>Dania</option><option>Estonia</option><option>Finlandia</option><option>Francja</option><option>Holandia</option><option>Islandia</option><option>Lichtenstein</option><option>Luxembourg</option><option>Niemcy</option><option>Norwegia</option><option>Polska</option><option>Szwajcaria</option><option>Szwecja</option><option>Słowacja</option><option>Słowenia</option><option>Wyspy Owcze</option><option>Węgry</option><option>Włochy</option><option>Łotwa</option></select></td>
                                 <td><select name="city" id="3"></select>

When the user in country3 select for example Polska, he gets in 2nd select cities from Polska. This cities are in database. How to do it?

Answer:1

This should be simple but I guess no jQuery makes it a bit difficult. I want to repeat a process where a div goes 100px to the right (with animation) and then 100px to the left (so i want a continuous ...

This should be simple but I guess no jQuery makes it a bit difficult. I want to repeat a process where a div goes 100px to the right (with animation) and then 100px to the left (so i want a continuous ...

  1. make a left and then a right

I have used Dylan's question on here regarding JavaScript syllable counting, and more specifically artfulhacker's answer, in my own code and, regardless of which single or multi word string I feed it, ...

I have used Dylan's question on here regarding JavaScript syllable counting, and more specifically artfulhacker's answer, in my own code and, regardless of which single or multi word string I feed it, ...

I am doing image editing integration with Aviary. Below is the html code <body> <a href="#" onclick="return launchEditor('editableimage1','http://www.html5canvastutorials.com/demos/assets/...

I am doing image editing integration with Aviary. Below is the html code <body> <a href="#" onclick="return launchEditor('editableimage1','http://www.html5canvastutorials.com/demos/assets/...

Hey I have a login form that when you click on the input the label move up, after focus out it checks if there is text in the input and if have the label stays up if dont the label comes down. My ...

Hey I have a login form that when you click on the input the label move up, after focus out it checks if there is text in the input and if have the label stays up if dont the label comes down. My ...

  1. jquery check input value
  2. jquery check input type
  3. jquery check input checkbox
  4. jquery check input has value
  5. jquery check input text value empty
  6. jquery check input checked
  7. jquery check input length
  8. jquery check input file empty
  9. jquery check input disabled
  10. jquery check input value change
  11. jquery check input pattern
  12. jquery check input number only
  13. jquery check input field not empty
  14. jquery check input value length
  15. jquery check input name
  16. jquery check input valid
  17. jquery check input type checkbox
  18. jquery check input file size
  19. jquery check input type select
  20. jquery check input change