473,387 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Drop down menu, load page on selected option

Hi,

I´m trying to create a simple application with a drop menu.
The drop menu should load a page inside the same page.
Same as the php inlude("path") function.

I´ve find one way to create this, but it´s only working in firefox!
PLEASE help me out if you have few minutes.

If you have a better way please do tell! =)

Tanks!

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function loadXMLDoc(url)
  3. {
  4. if (window.XMLHttpRequest)
  5.   {// code for IE7+, Firefox, Chrome, Opera, Safari
  6.   xmlhttp=new XMLHttpRequest();
  7.   }
  8. else
  9.   {// code for IE6, IE5
  10.   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  11.   }
  12. xmlhttp.open("GET",url,false);
  13. xmlhttp.send(null);
  14. document.getElementById('priser').innerHTML=xmlhttp.responseText;
  15. }
  16. </script>
  17.  
  18. </head>
  19.  
  20. <body>
  21. <h1><span class="redProdHeader"> Best&auml;llning av 
  22. affischer </span>  </h1>
  23. <form action="../tryckeri/form/offertTryckeriMail.php" method="post" name="offertTryckeri" id="offertTryckeri" enctype="multipart/form-data">
  24.  
  25.   <p><strong>Format:</strong><br />
  26.     <select name="button" >
  27.       <option>--- V&auml;lj Format ---</option>
  28.       <option value="b2" ></option>
  29.       <option value="a0" onclick="loadXMLDoc('../tryckeri/affischer/priser/A0Priser.php')">A0</option> 
  30.       <option value="a1" onclick="loadXMLDoc('../tryckeri/affischer/priser/A1Priser.php')">A1</option>
  31.       <option value="a2" onclick="loadXMLDoc('../tryckeri/affischer/priser/A2Priser.php')">A2</option>
  32.       <option value="a3" onclick="loadXMLDoc('../tryckeri/affischer/priser/A3Priser.php')">A3</option>
  33.       <option value="b1" onclick="loadXMLDoc('../tryckeri/affischer/priser/B1Priser.php')">B1</option>
  34.       <option value="b2" onclick="loadXMLDoc('../tryckeri/affischer/priser/B2Priser.php')">B2</option>
  35.       <option value="b2" ></option>
  36.       <option value="offert" onclick="loadXMLDoc('../tryckeri/form/offertTryckeri.php')">Offert förfrågan</option>
  37.     </select>
  38.   </p>
  39.   <br />
  40.   <div id= "priser">
  41.   </div>
  42.  
Mar 25 '10 #1
0 1874

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Greg Scharlemann | last post by:
I am attempting to populate a drop down menu based on the selection of a different drop down menu. However, it is not working correctly, I cannot figure out for the life of me what exactly happens...
1
by: Greg Scharlemann | last post by:
I would like to automatically populate a drop down menu when the page loads based on the selection of an item in a different drop down menu. I made a test page that when drop down #1 changes, drop...
6
by: mcgrew.michael | last post by:
I hope this is the right group. I am very new to ASP so this is probably a stupid question. I have some vbscript that query's AD and populates a recordset. I know the recorset contains the...
2
by: millertime90 | last post by:
Hi basically my problem is I have 2 drop down menus populated by my database the first populated by a field in the database and the 2nd populated with a relation to the value selected in the first...
1
by: sparksol | last post by:
I have a form with a drop down box. If you select an option in the drop down box (depending which option is selected) one or two textbox(es) and a submit button display. I would like to keep the...
1
by: Bobc003 | last post by:
Hi, I'd like to put a double drop-down menu on my webpage and instead of a redirection to a new webpage, I'd like to display the result in a new section. I'm kind of stuck and I only have a triple...
2
by: giandeo | last post by:
Hello all, It's almost a couple of weeks since i am struggling to get this code work. Unfortunately, i am stuck. There seems to be no hope... Please Help....... I am working with an asp page...
11
by: tokcy | last post by:
Hi everyone, I am new in php and ajax, i am facing the prob while i click on element of first drop down then in second dropdown all element showl come from database. I mean i have three dropdown 1....
2
by: phpnewbie26 | last post by:
I currently have two drop down menus where the second one is populated from the first one. My second drop down menu should be able to do multiple selection. I have searched online and found out how...
6
by: phpnewbie26 | last post by:
My current form has one multiple select drop down menu as well as few other drop down menus that are single select. Originally I had it so that the multiple select menu was first, but this created...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.