I´m trying to create a drop down menu that loads a page when a option is selected.
same as the php function "include("path")".
The code below works only for firefox :confused: not for IE, safari, chrome
Please help me out. I have tried to create this simple function for hours.
<script type="text/javascript">
function loadXMLDoc(url)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById('priser').innerHTML=xmlhttp.responseText;
}
</script>
</head>
<body>
<h1><span class="redProdHeader"> Beställning av
affischer </span> </h1>
<form action="../tryckeri/form/offertTryckeriMail.php" method="post" name="offertTryckeri" id="offertTryckeri" enctype="multipart/form-data">
<p><strong>Format:</strong><br />
<select name="button" >
<option>--- Välj Format ---</option>
<option value="b2" ></option>
<option value="a0" onclick="loadXMLDoc('../tryckeri/affischer/priser/A0Priser.php')">A0</option>
<option value="a1" onclick="loadXMLDoc('../tryckeri/affischer/priser/A1Priser.php')">A1</option>
<option value="a2" onclick="loadXMLDoc('../tryckeri/affischer/priser/A2Priser.php')">A2</option>
<option value="a3" onclick="loadXMLDoc('../tryckeri/affischer/priser/A3Priser.php')">A3</option>
<option value="b1" onclick="loadXMLDoc('../tryckeri/affischer/priser/B1Priser.php')">B1</option>
<option value="b2" onclick="loadXMLDoc('../tryckeri/affischer/priser/B2Priser.php')">B2</option>
<option value="b2" ></option>
<option value="offert" onclick="loadXMLDoc('../tryckeri/form/offertTryckeri.php')">Offert förfrågan</option>
</select>
</p>
<br />
<div id= "priser">
</div>


Sign In
Create Account

Back to top









