473,887 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dynamic list boxes

subashini Thiyagarajan
218 New Member
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 2873
shweta123
692 Recognized Expert Contributor
Hi,

here is the sample code

<script language=javasc ript type="text/javascript">
function f1(selobj)
{
var ind=selobj.sele ctedIndex;
var selobj1 =document.getEl ementById("Sele ct2");

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(th is);">
<option selected="selec ted">One</option>
<option selected="selec ted">Two</option>
<option selected="selec ted">Three</option>
</select>
<select id="Select2" style="width: 123px">
</select>

Shweta
Feb 19 '07 #2
subashini Thiyagarajan
218 New Member
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
subashini Thiyagarajan
218 New Member
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 New Member
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@rediffma il.com

Thanks & Regards,
Badri

Hi,

here is the sample code

<script language=javasc ript type="text/javascript">
function f1(selobj)
{
var ind=selobj.sele ctedIndex;
var selobj1 =document.getEl ementById("Sele ct2");

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(th is);">
<option selected="selec ted">One</option>
<option selected="selec ted">Two</option>
<option selected="selec ted">Three</option>
</select>
<select id="Select2" style="width: 123px">
</select>

Shweta
Feb 23 '07 #5
subashini Thiyagarajan
218 New Member
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
17692
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 Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
0
3522
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 boxes do not necessarily need to have a selection made to be used in the dynamic query. In essence the form can have selections made in all or none of its list boxes to form the dynamic query I am looking to get some feedback in reference to...
4
3809
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 the where clause of a sql string to send to SQL 2000 for a data set. Currenly I check each control with an IF statement to determine if something is filled in. If there is I begin building the where clause. Below is what I have done (and it...
6
4764
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 size of a thumbnail and set the sizemode to Stretch -- I get one thumbnail. I want to retrieve all the picture files (jpg, bmp) in a directory into an array list and then display this list as thumbnails on my form dynamically. So my question is...
2
2950
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 sub-report will capture what grades the student has achieved in a list of different subjects and the reason I need it to be dynamic is that students take different subjects. Basically I've been trying to doctor the KB article on dynamic
0
1427
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 able to convert it to a datacontrol field. Below is a portion of my current code behind. By the way I tried doing dynamic templates and was not able to get it to work. Please help, this is driving me nuts. Thanks
1
3758
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, and I have spent three days trying to debug but to no avail. Everything is OK when there are only two dependent list boxes, but when adding the third child list box, a problem appears: if I populate the third box only with the value: new...
2
5041
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 is this, I have a page which uses multiple postbacks to generate a list of dynamic text boxes with appropriate labels. However, when I do the final postback to enter the values in the dynamic textboxes into the database the values seem to become...
1
2971
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. Making a selection from list/box A (Qtr) selects a fiscal quarter, which then refreshes the values in list/box B (Mth), which shows the 3 months in that fiscal quarter, which then refreshes the values in list/box C (MthDate), which returns the date...
0
9957
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
9799
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
11173
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10771
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
10877
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,...
1
7988
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7143
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
6011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4633
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.