• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Is It Possible to Invoke An Action By Selecting an Option from a Drop-Down Menu?

Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can invoke actions by clicking on a Submit button or by clicking on a link. Is it possible to invoke an action by selecting an option from a drop-down menu? If the answer is "yes", how do we do it?
author & internet detective
Posts: 40035
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but you need to use Javascript too. If there is a different action depending on the value, you need to set that action. Regardless, use javascript to submit the form

(blur should be onBlur), but it's not letting me post that.
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing the same error.
When I try starting tomcat. I get the following error -

Sep 8, 2006 2:37:59 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /ch03app threw load() exception
javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/struts-config.xml

Here is the entry in struts-config.xml

<action path="/Lookup"
name="LookupForm" />
<forward name="success" path="/quote.jsp" />
<forward name="failure" path="/index.jsp" />

Can someone help me on this?
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OnBlur is fired even when the option is not changed. I believe the better way is to use OnChanged and OnBlur together. Something like below

and make the selection control like

<select name="change1" on blur="submitChange(this.form);" on change="onChangedSelection();">
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic