- Moderator
- #1
Stupid *&@(#*&$@# script.
All I want it to do is change the values of the drop-down, depending on which radio button is selected.
Here's a snippet.....
... but, when I change the radio button, which should fire the onClick="dropdown();" bit, it errors, and says Object Expected on the line that has the radio button.
<grumble>
Any thoughts about what I'm doing wrong? It's probably something obvious that I've overlooked....
Just my 2¢
-Cole's Law: Shredded cabbage
--Greg
All I want it to do is change the values of the drop-down, depending on which radio button is selected.
Here's a snippet.....
Code:
<html>
<head>
<script LANGUAGE='Javascript'>
function dropdown()
{
var objSelect = document.form1.Days;
while(objSelect.options.length > 1){objSelect.remove(1);}
if (document.form1.thelog[0].checked = true){
document.form1.Days.options = new Option ("All",99999);
document.form1.Days.options = new Option("1",1);
document.form1.Days.options = new Option("2",2);
document.form1.Days.options = new Option("3",3);
document.form1.Days.options = new Option("4",4);
document.form1.Days.options = new Option("7",7);
document.form1.Days.options = new Option("14",14);
} Else {
document.form1.Days.options = new Option("All",99999);
document.form1.Days.options = new Option("90",90);
document.form1.Days.options = new Option("180",180);
document.form1.Days.options = new Option("1 year",365);
document.form1.Days.options = new Option("2 years",730);
}
}
</script>
</head>
<html>
. . . etc
(and in a form)
<input type="Radio" Name="thelog" value="1" onClick="dropdown();" CHECKED>
Current Logs
<input type="Radio" Name="thelog" value="2" onClick="dropdown();">
Archived Logs
<font size=-1>(Note: Selection archived logs may take a long time! Over 1 million records...)</font>
</td></tr>
<tr>
<td>For how many days?</td><td> <select name="Days" size="1">
<option Selected value="99999">All</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option>7</option>
<option>14</option>
<option>30</option>
<option>60</option>
</select> Days <font size=-1><--- Current logs only go back 90 days.</font>
... and so forth
... but, when I change the radio button, which should fire the onClick="dropdown();" bit, it errors, and says Object Expected on the line that has the radio button.
<grumble>
Any thoughts about what I'm doing wrong? It's probably something obvious that I've overlooked....
Just my 2¢
-Cole's Law: Shredded cabbage
--Greg