No, it isn't true (at least in Netscape 4.x).

I'm doing this with three dropdown lists, where the HTML/JavaScript is (recursively) 
templated, and the options in the list are generated from a database.

Use the following JavaScript to remove all options from a list:

    while (document.form.list.length > 0) {
        document.form.list.options[0] = null
    }

Use the following JavaScript to add a new option to a list:

    document.form.list[index] = new Option(<parameters here>)

When you are done, use the following JavaScript to refresh the page:

    history.go(0)

Note that for the refresh to work, you must have memory caching enabled.

If anyone requires further info on this, please email me directly.

(I know.  I know.  I'm not practicing what I preach.  But this is something that is 
very useful to do from servlets, so I guess I won't flame myself too bad...)



Bart Cassady
Database Analyst
Corporate Technology Services
Associated Engineering Group Ltd.
[EMAIL PROTECTED]

>>> Milt Epstein <[EMAIL PROTECTED]> 04/12 10:54 AM >>>
On Wed, 12 Apr 2000, Shami, Muhammad wrote:

> This can be done through JavaScript. Using JavaScript you have to
> define JavaScript arrays of options in the list and as soon as one
> list changes you can call a function to replace one list with
> another.  Code is pretty simple.  If you need code I can post it.
[ ... ]

But isn't it true that JavaScript cannot change/redraw the page/frame
it is in, so you will need to use at least two frames -- one, perhaps
so small it is "invisible", that contains the JavaScript code, and the
other that contains what is displayed and calls the JavaScript code in
the other frame?  That is what I was told when I was looking into
something like this.


> -----Original Message-----
> From: Farman Khan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 12, 2000 9:46 AM
> To: [EMAIL PROTECTED]
> Subject: Re: dynamically changing lists
>
>
> Is it a JSP Page?
> Create a databean to get the contents of the drop down lists.
> Farman
>
> -----Original Message-----
> From: Vikas Gupta [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 12, 2000 5:59 AM
> To: [EMAIL PROTECTED]
> Subject: dynamically changing lists
>
>
> Hi
>         I have three drop down lists.Data in all three is coming from
> database.I want to change the content of two of the lists if first list is
> changed.Data in lists two and three depend on the data in list1.
> I donot want to call the servlet again.
> Any idea how to do it in an optimal way using javascript or any other idea.
> Regards,
> Vikas.
>

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to