Hello,
I borrowed an example from another post to try to do something for a page I'm working on but I seem to have something off.
The desired function of this is to allow the user to select a begining IP range from listbox 1 and then remove that selection and the preceeding selections from listbox 2. IE a range can't equal itself or a ip below the listbox 1 selection.
It seems close but I get an error object doesn't support property or method. If I skip past the error and try to select a new value from listbox 1 I noticed that the increment from the 2'nd selection attemp is added to the increment from the 1'st one.
I'd like the user to have the ability to change the selection as many times as they wish to get the range correct prior to sending the form.
Any ideas?
Thanks, Danzig
I borrowed an example from another post to try to do something for a page I'm working on but I seem to have something off.
The desired function of this is to allow the user to select a begining IP range from listbox 1 and then remove that selection and the preceeding selections from listbox 2. IE a range can't equal itself or a ip below the listbox 1 selection.
Code:
<html>
<head>
<title>select changer</title>
<script language="javascript">
function changeSel(sel1,sel2) {
// remove options
var curr = sel1.selectedIndex;
for (x = curr; x <= sel2.options.length - 1; x--){sel2.options[x] = null; x==0;}
}
</script>
</head>
<body>
<form>
<select name="list1" onchange="changeSel(this,this.form.list2);">
<option value="">10.80.92.1</option>
<option value="">10.80.92.2</option>
<option value="">10.80.92.3</option>
<option value="">10.80.92.4</option>
<option value="">10.80.92.5</option>
<option value="">10.80.92.6</option>
<option value="">10.80.92.7</option>
<option value="">10.80.92.8</option>
<option value="">10.80.92.9</option>
<option value="">10.80.92.10</option>
<option value="">10.80.92.11</option>
<option value="">10.80.92.12</option>
<option value="">10.80.92.13</option>
<option value="">10.80.92.14</option>
<option value="">10.80.92.15</option>
<option value="">10.80.92.16</option>
<option value="">10.80.92.17</option>
<option value="">10.80.92.18</option>
<option value="">10.80.92.19</option>
<option value="">10.80.92.20</option>
</select>
<select name="list2">
<option value="">10.80.92.1</option>
<option value="">10.80.92.2</option>
<option value="">10.80.92.3</option>
<option value="">10.80.92.4</option>
<option value="">10.80.92.5</option>
<option value="">10.80.92.6</option>
<option value="">10.80.92.7</option>
<option value="">10.80.92.8</option>
<option value="">10.80.92.9</option>
<option value="">10.80.92.10</option>
<option value="">10.80.92.11</option>
<option value="">10.80.92.12</option>
<option value="">10.80.92.13</option>
<option value="">10.80.92.14</option>
<option value="">10.80.92.15</option>
<option value="">10.80.92.16</option>
<option value="">10.80.92.17</option>
<option value="">10.80.92.18</option>
<option value="">10.80.92.19</option>
<option value="">10.80.92.20</option>
</select>
</form>
</body>
</html>
It seems close but I get an error object doesn't support property or method. If I skip past the error and try to select a new value from listbox 1 I noticed that the increment from the 2'nd selection attemp is added to the increment from the 1'st one.
I'd like the user to have the ability to change the selection as many times as they wish to get the range correct prior to sending the form.
Any ideas?
Thanks, Danzig