Hi, just wondering if anyone could help me. I am having trouble saving the selected value. This my javascript code:
<SCRIPT language=JavaScript>
function reload(form){
var val=form.target_proj_no.options[form.target_proj_no.options.selectedIndex].value;
self.location='main.php?target=assign_form_mode&type=p&target_proj_no=' + val ;
}
</script>
And this is some of my php code:
$selected = '';
$target_proj_no = $_GET['target_proj_no'];
$student_q = "SELECT p.proj_no, p.title FROM project p WHERE NOT EXISTS (SELECT * FROM moderated mod WHERE p.proj_no = mod.proj_no) AND EXISTS ( SELECT * FROM supervised s WHERE s.proj_no = p.proj_no) ORDER BY p.proj_no";
$result1 = $db->query($student_q);
if (DB::isError($result1))
die ($result1->getMessage());
print "<p class=\"bodyheading3\">Assign Moderator to Student</p>";
print "<form method=\"post\">";
print "<p class=\"bodytext\">Project : <select name =\"target_proj_no\" onchange = \"reload(this.form)\" ><option>-----Select One-----</option>";
while ($result1->fetchInto($row)){
$proj_no = $row[0];
$title = stripslashes($row[1]);
$concat_title = substr($title, 0, 30);
print "<option value=\"$proj_no\" >$proj_no. " . $concat_title;
}
print "</option></select></p>";
I would be grateful for any help. Thank you.