Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8698909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:49:37+00:00 2026-06-13T01:49:37+00:00

How to call action on onchange event with select option in struts2. Here is

  • 0

How to call action on onchange event with select option in struts2.

Here is my code and how can I integrate with On change event.

<s:select name="menuItem" list="menuItems" listKey="menuItemID"

listValue="menuItemName" headerValue="--MenuItems--"

cssClass="selectbox_bg2" id="select" />

Can anyone please provide an example..

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:49:39+00:00Added an answer on June 13, 2026 at 1:49 am

    There is no difference in how you apply onchange or any other javascript event handler to struts tag as compared to regular HTML tags. Struts2 select Tag Ref

    <s:select name="menuItem" list="menuItems" listKey="menuItemID"
    
    listValue="menuItemName" headerValue="--MenuItems--"
    
    cssClass="selectbox_bg2" id="select" onchange="handleChange(this.value)"/>
    

    JavaScript

    function handleChange(value){
      window.location="callMyAction?ValueToSubmit="+value; //or you can submit a form from here or make an ajax call
    }
    

    Or if you are using jquery then

    $("#select").change(function(e){
        var value = $(this).val();
        //submit a form or make ajax call or use window.location
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I use Jquery to call an action and then change the image when
<h:selectOneMenu id=selectOneMenu value=#{Bean1.val1} > <f:selectItems value=#{Bean1.selectItems}/> <a4j:support event=onchange action=#{Bean1.onSelectOneMenuChange} reRender=textbox1 , textbox2 , textbox3,
If I have the below code, should I just call the Action or should
I have one g:select with an onchange event that fires a remoteFunction that is
I am trying to make an onchange call on a select box.For my application
<form action=/path/hello.php name='myForm' method='post'> <!-- onChange=ajaxFunction(); --> <input type= text name=user id= txtname /><br
I call an action helper in one of my views using the following code
Im trying to build call to action button on my site using jQuery. I
Is there any way to call an action script function from an anchor which
I am using jQuery .load to call an action but it is not found.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.