php - xmlhttp.responseText to html code -
i trying display xmlhttp.responsetext html code , fill dropdownbox, seems processed string , not html code.
i using code display in html format various menu <option>s in <span> tag
javascript code within xmlhttprequest function:
document.getelementbyid("test").innerhtml=xmlhttp.responsetext; code in html found within dropdown menu:
< span id="test"> < /span> the php file called xmlhttprequest echo's following:
$option="<option>"; (this in while loop)
{ echo $option.$row['productname'].$option="<option>"; }
if want html outcome use html, don't use special chars.
in loop use
echo "<option>" . $row['productname'] . "</option>";
Comments
Post a Comment