• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

setting dynamic actions for a selection list?

 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use onchange or onblur in a selection list.

Eric
 
Pat Peg
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So no answer as to why OnChange fails to work?
 
In the renaissance, how big were the dinosaurs? Did you have tiny ads?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic