can any one help me in loading image along with its name in texbox loads the text by selecting a option in dependent dropdown using ajax..

Try following example

image_ajax.php

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title></head>

<body>
<script type="text/javascript" src="jquery-1.3.1.min.js"></script>

<script type="text/javascript">
function get1()
{   

alert('inside fun');

        var dgroup=$("#int_entry_id").val();
        alert(dgroup);


        $.post("test1.php",{dval:dgroup},function(data)
        {
            alert("ajax_loaded");

            //alert("data="+data);
            var image = new Image();
image.onload = function(){
    document.body.appendChild(image);
};
image.src = data;




        });


}
</script>



<form name="f">

<select name="int_entry_id" onChange="get1()" id="int_entry_id"  >
<option value=""  selected="selected">Select One</option>
<option value="1">1</option>
<option value="2">2</option>
</select>

</form>
<p id="img"></p>
</body>
</html>

test1.php

<?php

$group=$_POST['dval'];
if($group==1)
echo "p2.jpg";
if($group==2)
echo "p1.jpg";
?>
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.