I have the following code :
[PHP]$form = "<head><title>:::Subjects:::</title></head>
<script src='ajax_files/prototype.js'></script>
<script src='ajax_files/getSecond.js'></script>
<body>
<form action='subjects.php' method='get' enctype='multipart/form-data'>
<table width='394' border='1' align='center' cellpadding='5' cellspacing='5'>
<tr>
<td>Programe Name:</td>";
$sql = "select programe_name from programmes";
$result = mysql_query($sql, $conn) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
$add .="<option value='$row[programe_name]'>$row[programe_name]</option>";
}
$form .= "<td>
<select name='prog_name' id='prog_name' onchange='getSecond(this.value)'>
<option value=''>--Select--</option>
$add
</select>
</td>
</tr>
<tr>
<td>Semester:</td>
<td><span id=\"comboHint\">";
$include = include('ajax_files/sublist.php'); // i don't know wat to do here? How to include this file?
// include "ajax_files/sublist.php";
$form .= "$include</span>
</td></tr></table></form></body></html>";[/PHP]
I am actually getting the programe names from the table inside the select box.
Now i want whenever a programe name is selected, for e,g bba, a new list box should appear with the total no of semesters for it.
i dont know how to put the sublist.php file between <span> </span> tags and run it there.
In the sublist.php file i have my list box.
And another question is, how can i maintain the format/design of my form?
because when i echo the file sublist.php it is showing me the list box on the top left corner instead of inside the cell, which i have mentioned.