i want my ajax and php codes, with 2 option value, show up two different texts or form packs. i have given html and php codes. i hope sombedy help me. im quiet new with this. thanks :)

renkler.html :

<script type="text/javascript">

var istek = false;

if (window.XMLHttpRequest)
    istek = new XMLHttpRequest();
else if (window.ActiveXObject)
    istek = new ActiveXObject("Microsoft.XMLHTTP");
function.RenkGoster() {
    document.getElementById("kutu2").innerHTML = "lutfen bekleyiniz";

    var renk = document.getElementById("renk").value;   
    istek.open("GET", "form.php", true);
    istek.onreadystatechange = renkler;
function renkler() {
    if (istek.readyState == 4 && istek.status == 200)
        var cevap = istek.responseText;
        document.getElementById("kutu2").innerHTML = cevap;
<div align="center"><div id="cerceve"><div id="kutu1">
<select id="renk" onchange="RenkGoster()">
<option value="">Lutfen bir renk seciniz</option>
<option value="kirmizi">kırmızı</option>
<option value="mavi">mavi</option>

<div id="kutu2"></div></div></div></body></html> 

form.php :

$islem = $_GET["islem"];
$renk = $_GET["renk"];

if ($islem == "kirmizi")
    echo "oldu";
else if ($islem == "mavi")
    echo "olmadi";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.