hi,
anyhow know how to deselect the options value from a select box?
here i have 2 multiple select box, when i click 'add', it will added to second select box. Now my problem is how deselect the second option when user click a 'drop' button.
<html>
<head>
<link rel="StyleSheet" href="style.css" type="text/css" />
<title>Add Courses</title>
<script language="JavaScript">
<!--
function populateForm() {
for (var Current=0;Current < document.courseform.course
.options.l
ength;Curr
ent++) {
if (document.courseform.cours
e.options[
Current].s
elected) {
var defaultSelected = true, selected = true;
var optionName = new Option(document.courseform
.course.op
tions[Curr
ent].value
, document.courseform.course
.options[C
urrent].te
xt, defaultSelected, selected)
if (replacedfirst)
var length = document.courseform.addedc
ourse.leng
th;
else
var length = 0;
document.courseform.addedc
ourse.opti
ons[length
] = optionName;
replacedfirst = true;
}
}
}
var replacedfirst = false;
//-->
</script>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<form name="courseform" onSubmit="return false;">
<tr>
<td width="100%" colspan="3" class="Title">Course Selection</td>
</tr>
<tr>
<td width="17%"> </td>
<td width="83%" colspan="2"> </td>
</tr>
<tr>
<td width="17%" valign="top">Available Courses</td>
<td width="19%">
</p>
</td>
<td width="64%">
<p align="left">Added Courses</td>
</tr>
<tr>
<td width="20%">
<select size="10" name="course" multiple>
<option selected value="COMM3604 Systems Analysis & design">COMM3604 Systems Analysis & design</option>
<option value="COMP3201 Computer Graphics">COMP3201 Computer Graphics</option>
<option value="COMP3202 Modelling and Visualisation">COMP3202 Modelling and Visualisation</option>
<option value="COMP3300 Operating Systems">COMP3300 Operating Systems</option>
<option value="COMP3400 Models of Programming & Computation">COMP3400 Models of Programming & Computation</option>
<option value="COMP3401 Compilers & Interpreters">COMP3401 Compilers & Interpreters</option>
<option value="COMP3402 Concurrent & Real-Time Systems">COMP3402 Concurrent & Real-Time Systems</option>
<option value="COMP3500 The Software Process">COMP3500 The Software Process</option>
<option value="COMP3501 Human-Computer Interaction">COMP3501 Human-Computer Interaction</option>
<option value="COMP3502 Information Security">COMP3502 Information Security</option>
<option value="COMP3503 Interaction Design">COMP3503 Interaction Design</option>
<option value="COMP3600 Reasoning about Software">COMP3600 Reasoning about Software</option>
<option value="COMP3601 Software Specification">COMP3601 Software Specification</option>
<option value="COMP3701 Principles of Artificial Intelligence">COMP3701 Principles of Artificial Intelligence</option>
<option value="COMP3804 Information Technology Project">COMP3804 Information Technology Project</option>
<option value="COMS3200 Computer Networks I">COMS3200 Computer Networks I</option>
<option value="INFS3100 Introduction of Information Science">INFS3100 Introduction of Information Science</option>
<option value="INFS3200 Advanced Database Systems">INFS3200 Advanced Database Systems</option>
<option value="INFS3202 Web Information Systems">INFS3202 Web Information Systems</option>
</select> </td>
<td width="19%" align="center">
<input type="submit" value=" Add " name="add " onClick="populateForm();">
<br>
<input type="submit" value="Drop" name="drop"></td>
<td width="64%" valign="top">
<p align="left">
<select size="4" name="addedcourse">
<option value="">
</select></td>
</tr>
<tr>
<td width="17%"> </td>
<td width="19%" align="center"> </td>
<td width="64%"> </td>
</tr>
<tr>
<td width="17%"> </td>
<td width="19%" align="center">
<p align="right"> </td>
<td width="64%"> </td>
</tr>
<tr>
<td width="17%" valign="Top"> </td>
<td width="19%" align="center">
</td>
<td width="64%">
<p align="center">
<input type="submit" value="Submit" name="submit" style="float: right"></td>
</tr>
<tr>
<td width="17%"> </td>
<td width="19%" align="center">
</td>
<td width="64%">
</td>
</tr>
<tr>
<td width="17%"> </td>
<td width="19%" align="center">
</td>
<td width="64%">
</td>
</tr>
</form>
</table>
</body>
</html>