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

dynamic list boxes

subashini Thiyagarajan
hi,
any one can help me in dynamic list box selection with simple codings.

when the first list box item selected depents on the selected item another list box item should change.
Feb 18 '07 #1
5 2850
shweta123
692 Expert 512MB
Hi,

here is the sample code

<script language=javascript type="text/javascript">
function f1(selobj)
{
var ind=selobj.selectedIndex;
var selobj1 =document.getElementById("Select2");

selobj1.options.length=0;
if (ind == 0)
{
selobj1.options[selobj1.options.length] = new Option('first choice');
}
if(ind == 1)
{
selobj1.options[selobj1.options.length] = new Option('second choice');
}
}

</script>
</head>


<select id="Select1" style="width: 119px" onchange="f1(this);">
<option selected="selected">One</option>
<option selected="selected">Two</option>
<option selected="selected">Three</option>
</select>
<select id="Select2" style="width: 123px">
</select>

Shweta
Feb 19 '07 #2
Shwetha,

thank u so much for your reply.but for me the content is huge i need to retrieve the list box items from a database.can u please help me.i am using access.


as per the first list box second and third list boxes should fill the same content.

pls help me.
Feb 22 '07 #3
shwetha,
i have succedeed in my codings i got it.now it is working fine thanks a lot for your initiative.
Feb 22 '07 #4
bullsb
1
Hi Shweta,

Thanks shweta I was in search for this piece for a long time. Can u help me in sending the same using VB Script instead of Java Script. to my ID bullsb@rediffmail.com

Thanks & Regards,
Badri

Hi,

here is the sample code

<script language=javascript type="text/javascript">
function f1(selobj)
{
var ind=selobj.selectedIndex;
var selobj1 =document.getElementById("Select2");

selobj1.options.length=0;
if (ind == 0)
{
selobj1.options[selobj1.options.length] = new Option('first choice');
}
if(ind == 1)
{
selobj1.options[selobj1.options.length] = new Option('second choice');
}
}

</script>
</head>


<select id="Select1" style="width: 119px" onchange="f1(this);">
<option selected="selected">One</option>
<option selected="selected">Two</option>
<option selected="selected">Three</option>
</select>
<select id="Select2" style="width: 123px">
</select>

Shweta
Feb 23 '07 #5
Swetha,

Can u please help me again.the codings which u have send meant for only one item in the list box.i need to populate more items from the database(Access)
can any one pls help me with the simple codings

thanks
Mar 6 '07 #6

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

Similar topics

1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
0
by: starace | last post by:
I have designed a form that has 5 different list boxes where the selections within each are used as criteria in building a dynamic query. Some boxes are set for multiple selections but these list...
4
by: Brian Shannon | last post by:
I have 3 combo boxes and two date text boxes on a .aspx page. The user can fill in any of the 5 controls or none to filter a datagrid. I was hoping someone could explain how to efficiently build...
6
by: Rich | last post by:
Hello, I want to simulate the dynamic thumbnail display of Windows Explorer (winxp) on a form or pannel container. If I place a picture box on my container form/pannel and dimension it to the...
2
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
0
by: mtsylvester | last post by:
Hi All, How do I add a List Box to a dynamic Details View. I want to replace the check boxes with list boxes. If I try to simply replace the check box with a list box it complains about not being...
1
by: skyson2ye | last post by:
Hi, guys: I have written a piece of code which utilizes Javascript in PHP to create a three level dynamic list box(Country, States/Province, Market). However, I have encountered a strange problem,...
2
by: englishman69 | last post by:
Hello, I have been banging my head against this one for a while... Searches online have revealed many different proposals for correcting my issue but none that I can follow! My basic situation...
1
by: jmartmem | last post by:
Greetings, I have a nagging problem with client-side dynamic dependent list boxes that perhaps someone can help me troubleshoot. I have a form with a series of dynamic dependent list boxes....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.