Ajax Function On Change Dropdown Value
Hie Everyone! In PHP page1 my code is here.. . ... .. ....
Solution 1:
You will give echo infront of the $get_id variable. But you will make sure only one echo in the page2.php page.
<?phpecho$get_id=$_GET['pass_id'];
...
//db connection code
..
$sql="select * from Table1 where id='$get_id'";
//result code..//while loop..//echo something..// all working without error..?>
Then in page1.php check your ajax response. using alert function.
<script>
$('#customer').change(function(){
var id = $(this).val();
$.ajax({
type: "GET",
url: "page2.php",
data: "pass_id="+id,
success: function( data ) {
alert(data);
document.getElementById("show").innerHTML = data;
}
});
});
</script>
Post a Comment for "Ajax Function On Change Dropdown Value"