File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Prototype Framework issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Prototype Framework issue" Watch "Prototype Framework issue" New topic

Prototype Framework issue

Jaco Gillman

Joined: Apr 01, 2008
Posts: 1

I am very new at prototype and AJAX so any assistance would be much appreciated. some some examples on JavaRanch that covers the prototype topic but none that can help me figure out how to solve the problem I have.

In our project we have a <SELECT> tag with a list of location objects. The initial load of this list of locations all have some storage located to them. At the end of this list I want add an additional �more�� option so that when the user selects this option, it will populate the same drop down box with ALL of the available locations. I have tried to do this and the search the net but could not find anything helpful.

We are using LookupDispatchAction action classes in Struts and JSPs. The onchange event listener on the location select tag will trigger this prototype function. Do you have any suggestions for how I can accomplish this using prototype? Thanks in advance!!

Mohammed Yousuff
Ranch Hand

Joined: Oct 17, 2007
Posts: 198

try this link
Dynamic Options, you have a example code where the options can be added dynamically.

this examples don't uses prototype but satisfy your requirement ..

let me know i you have any comments ...

My Thoughts :
Try not to become a man of success but rather to become a man of value.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

What you do on the server makes no difference to Prototype code running on the client. So mentioning Struts and the like just confuses the issue.

It should be a simple matter to obtain the new data from the server, perhaps in JSON format, and to use the API of the Select element to add new items to its options.

What have you written so far? Where are you stuck?

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Prototype Framework issue
It's not a secret anymore!