This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
Marshal
Posts: 38249
623
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JiaPei,
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.
 
Greenhorn
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-mappings>
<action path="/Lookup"
type="ch03.LookupAction"
name="LookupForm" />
<forward name="success" path="/quote.jsp" />
<forward name="failure" path="/index.jsp" />
</action>
</action-mappings>


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();">
 
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!