gimme_this_gimme_that
Mon Sep 15 17:28:06 CDT 2003
Paul,
Study this example. Paste this html code into a file and view it.
You'll need to make a javascript function for each rep from in the
ASP.
<html><head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function onChange_Rep(ob){
var ii = 0
var ix = ob.selectedIndex
var cat_value = ob.options[ix].value
// hardcoded these categories, can generalize later
if (cat_value == "0")
load_SW_urls()
if (cat_value == "1")
load_GD_urls()
}
function load_SW_urls(){
// Keep deleting first item til all gone
while (document.aForm.thread.length)
document.aForm.thread.options[0] = null
len = document.aForm.thread.length;
document.aForm.thread.options[len] = new
Option("
http://www.joinarnold.com", "0",false,true)
len = document.aForm.thread.length;
document.aForm.thread.options[len] = new
Option("
http://joinarnold.meetup.com", "1",false,true)
}
function load_GD_urls(){
// Keep deleting first item til all gone
while (document.aForm.thread.length)
document.aForm.thread.options[0] = null
len = document.aForm.thread.length;
document.aForm.thread.options[len] = new Option("
http://www.aclu.org",
"0",false,true)
len = document.aForm.thread.length;
document.aForm.thread.options[len] = new
Option("
http://www.totalrecall2003.com", "1",false,true)
}
function button_focus()
{
document.aForm.rep.focus()
}
function do_onload() {
load_SW_urls();
button_focus();
}
//-->
</script>
</head><body onLoad="do_onload()" bgcolor=efefaaa >
<center>
<form name=aForm>
<table cellpadding=3 cellspacing=0 border=1 bgcolor=silver width=280 >
<td bgcolor=silver>
<p>
<font face="Tacoma, Verdana, Helvetica" size=2>
<b>Rep</b></font>
<td bgcolor=silver>
<p>
<font face="Tacoma, Verdana, Helvetica" size=2>
<b>Thread</b></font>
</tr>
<tr bgcolor=silver>
<td valign=top>
<select name="rep" onChange="onChange_Rep(this)" >
<option value="0">Arnold Schwarzenegger</option>
<option value="1">Graay Daviss</option>
</select>
<td rowspan=3 valign=top>
<select name="thread" size=1 >
<option value="bogus">____________________</option>
</select>
</tr>
</table>
</form>
</center>
</body>
</html>