Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 10th, 2004, 05:56 AM
Friend of Wrox
Points: 486, Level: 7
Points: 486, Level: 7 Points: 486, Level: 7 Points: 486, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: Athens, , Greece.
Posts: 105
Thanks: 0
Thanked 0 Times in 0 Posts
Default Onchange listbox

Hello!

I need some help here!

I have two listboxes with numbers from 1 to 30 (in the same page). When a user selects a value in the 1st listbox I want this value to be inserted in the 2nd listbox too... So, how can I do this?

Thank you in advance!!!
 
Old June 16th, 2004, 07:45 AM
Authorized User
 
Join Date: Jun 2004
Location: Tirupati, Andhra Pradesh, India.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Vagelis,

  Cosider two listboxes d1,d2
  to add values to d2 on clicking yo have to write the following in the script

  document.forms[0].d2.options[0] = new Option(DisplayNmae,OptionValue);
  Here Display Name is display value in the list box and Option Name is the name of that value.
   to add numbers eg 45,46 to list box u have to write
    document.forms[0].d2.options[0] = new Option("45","item1");
    document.forms[0].d2.options[1] = new Option("46","item2"); ...

Here onwards plz specify u'r query clearly,Here u din't said whether the query is on HTML or some thing else.

let me here from u..

Prasanth.c


prasanth.c




Similar Threads
Thread Thread Starter Forum Replies Last Post
Event:OnChange catchrohith Classic ASP Basics 0 November 3rd, 2006 12:52 AM
OnChange issue kdyer Beginning PHP 2 October 4th, 2006 06:45 AM
submit form on listbox onchange webnitro Javascript How-To 3 December 10th, 2005 08:31 PM
'onChange' crmpicco Javascript How-To 2 January 28th, 2005 05:37 AM
access listbox in onchange event ozcyberus1 JSP Basics 0 September 6th, 2004 05:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.