Form.php
echo("<div id='myDv'>");
echo("<select id='mySelect'>");
echo("<span id='mySpan'>");
//here I want dynamically generated option values
echo("</span>");
echo("</select>");
echo("</div>");
myJquery.js
$.post('Process.php', $(this).serialize(), function(data){
$('#mySpan').html(data);// I tried, but does'nt work
}).fail(function() {alert( "Some Problem Occured" );});
Process.php
$strSql="SELECT Id, Title FROM mytable";
$result=mysql_query($strSql);
while($rowSet=mysql_fetch_array($result)) {
echo("<option value=".$rowSet['Id'].">".$rowSet['Title']."</option>");
}
My requirement is to use the Id and Title obtained in Process.php, to create select options that will be displayed in the Form.php.
What changes are required in my code? How can I access the $rowSet of Process.php in myJquery.js, to create the select options, that I want to display in Form.php