hi,
i have a site page where visitors can choose between AMD processors and Intel processors.
when they choose AMD they get a amd drop down menu, and with Intel they get a intel menu.
that worked until i tried adding php to the submenu's.
when i choose Intel nothing changes and the same goes with AMD.
so i donno what i did wrong, maybe some1 can fix it i know lots of ppl know the solution to this (right?)
please help me!
This is my php file:
<html>
<head>
<title>PC-Samenstelling</title>
<?php
$sid = "2";
include "mode.php";
$query = mysql_query("SELECT * FROM product WHERE sid='$sid'");
?>
<script language="javascript">
//
IE = (document.all)?1:0;
NS = (document.layers)?1:0;
detail0 = '';
detail1='
<?php
while ($row = mysql_fetch_array($query)) {
echo "maineditor.document.write(\"<option value=\"$row[3]\">$row[3]</option>';\");";
}
?>
detail2='<option value="amd2">AMD Processor 1</option><option value="amd2">AMD Processor 2</option>';
function ChangeDetail(pos) {
pos = pos.merkprocessor.options[pos.merkprocessor.selectedIndex].value;
temp = '<select name="processor">"<option value="0">--(Kies een Processor)--</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>
</head>
<body>
<form action="http://www.flashtweax.sonnexh.com/webwinkel/shop/verder.php" method="POST">
<b>Kies een Merk voor uw Processor:</b>
<select name="merkprocessor" onChange=ChangeDetail(this.form)>
<option value="0" selected>--(Kies een merk voor uw processor)--</option>
<option value="1">Intel Processor</option>
<option value="2">AMD Processor</option>
</select></p>
<input type="submit" value="Verzenden "><input type="reset"
value="Reset"></font></p>
</form>
</body>
</html>
and the origional javascript is:
<html>
<head>
<title></title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form" method="post" action="">
<table cellspacing=0 cellpadding=0 width=773 align=center border=0 bgcolor="#FFFFFF">
<tbody>
<tr>
<td>
<table cellspacing=0 cellpadding=0 width="100%" border=0>
<tbody>
<tr>
<td valign=top>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="767" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="283"><b>Kies een Merk voor uw Processor</b> </td>
<td width="480">
<select name="merkprocessor" onChange=ChangeDetail(this.form)>
<option value="0" selected>--(Kies een merk voor uw processor)--</option>
<option value="1">Intel Processor</option>
<option value="2">AMD Processor</option>
</select>
</td>
</tr>
<tr>
<td width="283"><b>Kies een Processor:</b></td>
<td width="480">
<div id=newDetail1>
<select name=processor>
<option value="0" selected>--(Kies eerst een Merk voor uw processor)--</option>
</select>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</form>
<script language="javascript">
//
IE = (document.all)?1:0;
NS = (document.layers)?1:0;
detail0 = '';
detail1='<option value="intel1">Intel Processor 1</option><option value="intel2">Intel Processor 2</option>';
detail2='<option value="amd2">AMD Processor 1</option><option value="amd2">AMD Processor 2</option>';
function ChangeDetail(pos) {
pos = pos.merkprocessor.options[pos.merkprocessor.selectedIndex].value;
temp = '<select name="processor">"<option value="0">--(Kies een Processor)--</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>
<noscript></noscript>
</body>
</html>