Dear experts, I have the following code,
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="Naveed" />
<title>Untitled 2</title>
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript">
$(document).ready( function(){
<script type="text/javascript">
$("#D1").load('result.php',function (str){
var options = $("#D1");
options.append($("<option />").val("").html("Roll No"));
$.each(str, function(str,text) {
options.append($("<option />").val(text).html(text));
});
});
});
</script>
</head>
<body>
<select size="1" id="D1">
</select>
</body>
</html>
result.php
<?php
$a[0] ='89';
$a[1] ='53';
$a[2] = '67';
for ($x=0;$x<count($a);$x++)
{
echo $a[$x];
}
?>
the values in select box gets are not 89, 53 and 67 but 8,9,5,3,6,7 please help why its like that?
thanks in advance and regards.