Hi,
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")".
Please help me out. I have tried to create this simple function for hours. :confused:
drop down menu to load a page
Started by farhad, Mar 24 2010 04:21 PM
3 replies to this topic
#1
Posted 24 March 2010 - 04:21 PM
|
|
|
#2
Posted 24 March 2010 - 05:06 PM
never mind the problem is solved!
#3
Posted 24 March 2010 - 10:08 PM
I´ll take that back... my solution only works with firefox, not IE,Safar,Chrome....
this is my code
PLEASE help me out =(
this is my code
<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>
PLEASE help me out =(
Edited by farhad, 24 March 2010 - 10:09 PM.
i was to fast
#4
Posted 25 March 2010 - 07:06 AM
There is a javascript forum a bit lower on the website ;)


Sign In
Create Account

Back to top









