473,396 Members | 1,995 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,396 software developers and data experts.

how to add Option Values

Hi all,
i am new to this forum. Please anyone say how to add the option values which is stored in arrays using javascript.
Aug 27 '07 #1
2 1419
phvfl
173 Expert 100+
Hi Dominick,

Are you adding the options to an existing select or are you creating the entire drop down box from javascript?
Aug 27 '07 #2
dmjpro
2,476 2GB
Hi all,
i am new to this forum. Please anyone say how to add the option values which is stored in arrays using javascript.

Welcome to TSDN.
Actually this site for beginner as well as for Advance.
And it would be better if you come with some code.
Anyway I am trying to solve your problem.

Expand|Select|Wrap|Line Numbers
  1. <select id = sel>
  2. </select>
  3.  
Expand|Select|Wrap|Line Numbers
  1. var sel_ref = document.getElementById('sel');
  2. //Your array list is ...........options..It's  two dimensional array that contains value //and options
  3. for(var i=0;i<options.length;i++)
  4. {
  5.     sel_ref.options[i] = new Option(options[i][0],options[i][1]);
  6. }
  7.  
Try this code I think it ll work fine.
Best of luck with your try.

Kind regards,
Dmjpro.
Aug 27 '07 #3

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

Similar topics

4
by: Sam Smith | last post by:
I am using optparse for the commandline parsing for my programs. I was wondering if it is possible to detect if an option or option-arg has been specified on the commandline by the user or not....
11
by: Harlin Seritt | last post by:
There are certain options for Tkinter widgets that have default values that I don't much care for (borderwidth, font come to mind) and continuously change when I'm building interfaces. With a bit...
3
by: julian | last post by:
hi I was wondering if anyone can help me out on this.... I have dynamcally populated a drop down menu with data from an access database using ASP. The values seem fine, however when i pass...
4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
9
by: Ritesh Raj Sarraf | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I'm using optparse module to parse all options and arguments. My program uses mostly "option arguments" hence my len(args) value is always...
1
by: Stephen D Cook | last post by:
What I am trying to do is have a set of option buttons which are required to click one. If the person doesn't click any before insert, they get an error. If they do click one, it inserts into the...
4
by: magix | last post by:
Hi, in my SELECT (like below), the option value has 2 values, separated with comma "," <select name="sIdName"> <option value="10,John">John</option> <option value="11,Eva">Eva</option>...
13
by: alive84 | last post by:
Hi there, I have a two problems concerning option button values on a report and data report creator reports. The situation: I have three option value boxes two have 3 option and one has...
1
flexsingh
by: flexsingh | last post by:
Hello there I have kinda got gotten myself into a sticky situation. I am trying to do something which seams too big to do in my head but I feel I kinda know how to do it. My problem is I have a...
1
by: bytesFTW99 | last post by:
I have been struggling with this for some time can anyone help out? just trying to have 3 dropdown boxes that fill depending on what is selected, then in some cases click a button and have the second...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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,...

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.