I am having problem displaying this select list.
My list is such a way that when the user choose CARS, another set of select options will be displayed and if BIKES is chosen there will be another set....
this code is on my edit page... I want to see what the user has chosen before.... I can only do it for the first select list... but cannot display whatever is it in the 2nd list
Code: Select all
<script language=javascript1.2>
IE = (document.all)?1:0;
NS = (document.layers)?1:0;
detail0 = '';
detailCARS='<option value="Porsche">Porsche</option><option value="Ferrari">Ferrari</option><option value="BMW">BMW</option>';
detailBIKES='<option value="Honda">Honda</option><option value="Phantom">Phantom</option>;
function ChangeDetail(pos) {
pos = pos.GENRE.optionsїpos.GENRE.selectedIndex].value;
temp = '<select name="SUB">"<option value="0">Select a Sub-Genre</option>"' + eval("detail" + pos) + '</select>';
if(IE){ newDetail1.innerHTML=(temp)}
else if(NS){
document.newDetail1.document.write(temp)
document.newDetail1.document.close()
document.write("abcdef");
}
}
</script>
<br><br><td><b>Selection:</b><select name="GENRE" onChange=ChangeDetail(this.form)>
<OPTION VALUE="0" selected>Select Genre</option>
<OPTION VALUE="CARS" <?php if (isset($g) && $g == "CARS") echo 'SELECTED'; ?>>Alternative Rock</option>
<OPTION VALUE="BIKES" <?php if (isset($g) && $g == "BIKES") echo 'SELECTED'; ?>>Blues</option>
</SELECT>
<BR>  
<div id=newDetail1>
<select name="SUB">
<option value="0">-------------</option>
</select>
</div>