I have the following code:
private function html_Headers()
{
$data = '
<!DOCTYPE HTML>
<head>
<script type="text/javascript">
function getOptions(chosen){
var selbox = document.myform.selectport;
selbox.options.length = 0;
if (chosen == "1") {
selbox.options[selbox.options.length] = new Option("-----------------","0");
}
}
</script>
</head>';
I'm trying to run some php mysql queries within the getOptions() JS function. I tried writing tags but it didn't work. Does anyone see the problem here? Note that this is within a PHP class file.