aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes setting dynamic actions for a selection list? 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 "setting dynamic actions for a selection list?" Watch "setting dynamic actions for a selection list?" New topic
Author

setting dynamic actions for a selection list?

Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
I have a page that contains multiple input fields of different types all contained in one form. I determine what action to take based on the following JS function

Inside the form/page I do


This is all working well for a submit button but now I need to do it for a drop down list as well in the same page. Has anyone done this and can you give me an example of how to expand what I am currently doing to include selection list?

Thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Use onchange or onblur in a selection list.

Eric
Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
I am trying something like that. This is what I have added...



So this is what I think it should be doing. An item is selected from the drop down list and nav() is called.
I set a parameter, "OptionOne" to be the value of what ever was selected in the pull down.
I then forward to the same page I am on but now I can use the selected parameter. How far off am I?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
why are you setting parameters? When you submit a form the values are passed to the next page. Am I missing something?

Eric
Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
More then likely I am missing something. The reason I am setting parameters is because I am trying to accomplish the following:
Item selected from list 'A', page reloads and that item 'A' will effect the values that are displayed in List 'B'. List 'B' is selected and that value will effect the items displayed in List 'C', etc. I am trying for a cascading effect of options provided based on the previous data selected.

In the above example, "OptionOne is a parameter not previously declared and will be a filter for another selection list on the page. Am I taking the long road to get across the street here?
Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
Another odd thing is that when the page first loads it executes a java print statement that I put in the javascript function to trace the action. It will not execute again if I do select something from the menu.
Kyle Smith
Greenhorn

Joined: Aug 02, 2005
Posts: 4
So no answer as to why OnChange fails to work?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setting dynamic actions for a selection list?