473,806 Members | 2,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating new set of dropdown menus on selection

54 New Member
when an option is choosen from a dropdown list using select tag and based on which option was selected How to create a new set of dropdown menu just beside the original dropdown list.

Also from this new drop down that a user selects how can this value be passed to a php file in order to read which value was chosen from the newly creted drop down menu.

please advice
Sep 19 '07 #1
1 1202
dmjpro
2,476 Top Contributor
when an option is choosen from a dropdown list using select tag and based on which option was selected How to create a new set of dropdown menu just beside the original dropdown list.

Also from this new drop down that a user selects how can this value be passed to a php file in order to read which value was chosen from the newly creted drop down menu.

please advice
Ok!
Try this code.

Expand|Select|Wrap|Line Numbers
  1. function change_options()
  2. {
  3.  var sel_ref = document.getElementById('sel2');
  4.  sel_ref.options.length = 0; 
  5.  //Make it empty if it contains some options previously.
  6.  var op1 = new Option("value_here","text_here");
  7.  //May be the sequence of value & text changed...Make sure of that.
  8.  sel_ref.options[0] = op1;
  9.  //Make the list in this way.
  10. }
  11.  
Expand|Select|Wrap|Line Numbers
  1. <select id = sel1 onchange = "change_options()">
  2. .
  3. .
  4. .
  5. .
  6. </select>
  7. <select id = sel2></select> <!--Empty Drop-Down Box-->
  8.  

Good Luck. :)

Kind regards,
Dmjpro.
Sep 19 '07 #2

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

Similar topics

1
2554
by: Andrea Bampi | last post by:
I'm just trying to do my first experiments with js, but I need some good examples to start with.. I need to design a dynamic form with two dropdown menus picking their select values from a db: my problem is, how can I make the selection in the first menu affect the value list in the second, without using any buttons? I mean, you just have to click on the first menu and select the desired item, then the proper select list is "loaded" into...
10
2303
by: JL | last post by:
Does anyone have any ideas on this please? I don't know how to evaluate the no-blank selections against each other from a form as follows: . I have a form with 6 dropdown fields, each containing a selection of 30 options (the 30 options are the same for each dropdown list). The user needs to select 'one of the 30 options' from each dropdown selection, but each option they select must be unique (no duplicate selections) or it must be...
3
11530
by: cefrancke | last post by:
The only reason I ask is that no one has made this subject clear or given a definitive answer. What I would like to do is, after turning off all the menus/tbars/etc using the startup options. Upon restarting Access, when an admin is detected (I use a GetSystemUser() function) I want to restore everything so that Access behaves like normal, ie. all menus/tbars/etc show up (only where they are supposed to show up).
5
6190
by: plumba | last post by:
Hi all. I have two drop down menus, the first a list of Departments, the second a list of Sections. Each Department has a set of Setions, so the Sections dropdown contains complete list of all Sections for every Department. I would like to filter out the Section dropdown based on what Department the user selects, to stop the user selecting a Section not relevant to the chosen Department. The Section list is very long other wise I'd...
0
9719
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9598
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10371
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10373
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9192
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5683
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.