473,466 Members | 1,381 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Does an example exist?

Hello,
I would like to improve my web project with javascript for this task:

I have a form where users must choose a main category( presented by a
drop-down menu) and according to this main category selection, another
drop-down menu is shown with a list of subcategories suitable for this
main category (that a user had chosen).

Is there an example of this available where I could learn how to do
that in javascript?
Thank you for help.

L.

Oct 4 '06 #1
6 1401

i do think there are several examples available but would you like to
see a new dropdown to appear as soon as you change the selection in the
dropdown?

i would add an onchange event on the dropdown where the onchange will
set the visibility of a value related dropdown. this is the most
easiest way.

PythonistL wrote:
Hello,
I would like to improve my web project with javascript for this task:

I have a form where users must choose a main category( presented by a
drop-down menu) and according to this main category selection, another
drop-down menu is shown with a list of subcategories suitable for this
main category (that a user had chosen).

Is there an example of this available where I could learn how to do
that in javascript?
Thank you for help.

L.
Oct 4 '06 #2
PythonistL wrote:
Hello,
I would like to improve my web project with javascript for this task:

I have a form where users must choose a main category( presented by a
drop-down menu) and according to this main category selection, another
drop-down menu is shown with a list of subcategories suitable for this
main category (that a user had chosen).

Is there an example of this available where I could learn how to do
that in javascript?
Try this:

<URL: http://www.javascripttoolbox.com/lib/dynamicoptionlist/ >
--
Rob
Oct 4 '06 #3

Maqish wrote:
i do think there are several examples available but would you like to
see a new dropdown to appear as soon as you change the selection in the
dropdown?

i would add an onchange event on the dropdown where the onchange will
set the visibility of a value related dropdown. this is the most
easiest way.
Maqish,
Can you please send me URL where I can see the examples. I am a newbie
with Javascript.
I am not sure how I can pair a main category with all appropriate
subcategories
Thank you
L.

Oct 4 '06 #4

take a look at the example RobG handed you..

if that is not what you would like to do i will give you an example

PythonistL wrote:
Maqish wrote:
i do think there are several examples available but would you like to
see a new dropdown to appear as soon as you change the selection in the
dropdown?

i would add an onchange event on the dropdown where the onchange will
set the visibility of a value related dropdown. this is the most
easiest way.
Maqish,
Can you please send me URL where I can see the examples. I am a newbie
with Javascript.
I am not sure how I can pair a main category with all appropriate
subcategories
Thank you
L.
Oct 4 '06 #5
Maqish wrote:
take a look at the example RobG handed you..

if that is not what you would like to do i will give you an example
Maqish,
Thank you for your reply and thank you RobG for the link
http://www.javascripttoolbox.com/lib/dynamicoptionlist/

It looks almost what I need but there is one problem.

For example if a user select
girl and a name Jane, the script returns Jane.
Is it so?

But for further processing, in my program, I would need to link a name,
with a number.
For example:
if a user select Jane I would need a return value e.g. 00101,
similarly,
if a user select Angie, from that example( at
http://www.javascripttoolbox.com/lib/dynamicoptionlist/ )
the user will see Angie, in the dropdown menu, but the program will
receive e.g. 00201 or what ever different value from that being seen
in the dropdown menu

Is it possible?
Thank you for the reply
L.

Oct 4 '06 #6
The value of an item can be different from the display value it has.

<select name="cars">
<option value ="01">Volvo</option>
<option value ="02">Saab</option>
<option value ="03" selected="selected">Opel</option>
<option value ="04">Audi</option>
</select>

you can read the selected value from the cars element and use that to
fill the other element
here is a nice example that shows howto do that..

http://lists.evolt.org/archive/Week-...07/015298.html

PythonistL wrote:
Maqish wrote:
take a look at the example RobG handed you..

if that is not what you would like to do i will give you an example
Maqish,
Thank you for your reply and thank you RobG for the link
http://www.javascripttoolbox.com/lib/dynamicoptionlist/

It looks almost what I need but there is one problem.

For example if a user select
girl and a name Jane, the script returns Jane.
Is it so?

But for further processing, in my program, I would need to link a name,
with a number.
For example:
if a user select Jane I would need a return value e.g. 00101,
similarly,
if a user select Angie, from that example( at
http://www.javascripttoolbox.com/lib/dynamicoptionlist/ )
the user will see Angie, in the dropdown menu, but the program will
receive e.g. 00201 or what ever different value from that being seen
in the dropdown menu

Is it possible?
Thank you for the reply
L.
Oct 5 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
11
by: BoonHead, The Lost Philosopher | last post by:
I think the .NET framework is great! It's nice, clean and logical; in contradiction to the old Microsoft. It only saddens me that the new Microsoft still doesn't under stand there own...
0
by: Dirk Försterling | last post by:
Hi all, a few days ago, I upgraded from PostgreSQL 7.2.1 to 7.4, following the instructions in the INSTALL file, including dump and restore. All this worked fine without any error (message). ...
3
by: mrwoopey | last post by:
Hi, I am using the example "Authenticate against the Active Directory by Using Forms Authentication and Visual Basic .NET": http://support.microsoft.com/default.aspx?scid=KB;EN-US;326340 ...
4
by: Mike | last post by:
Hi, I am looking for function in .Net library that let me know if exist any file if I specified template. Eg: I specify "*.txt" and if any file (1.txt, 2.txt, .. ) exists then I can get True...
16
by: lawrence k | last post by:
I've a file upload script on my site. I just now used it to upload a small text document (10k). Everything worked fine. Then I tried to upload a 5.3 meg Quicktime video. Didn't work. I've...
14
by: webEater | last post by:
I have a problem, it's not browser specific, and I don't get a solution. I have an (X)HTML document, I show you a part of it: .... <!--<div class="pad">--> <div id="eventImages"><img src=""...
19
by: Angus | last post by:
I have a socket class CTestClientSocket which I am using to simulate load testing. I create multiple instances of the client like this: for (int i = 0; i < 5; i++) { CTestClientSocket* pTemp...
1
by: =?Utf-8?B?TWFoZXNoIE5pbWJhbGthcg==?= | last post by:
On my page, I have ObjectDataSource and ListView. In Oninit method, I am setting selected value of Listbox. In above scenario, it throws error if I set SelectedValue property of ListBox and if...
3
by: moltendorf | last post by:
I copied the files from my "test" database on my old server (MySQL was not running) to my new server ("./mysql/data/test" folder), and after starting the server, SHOW TABLES; shows all of the tables...
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
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.