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

  • Home
  • SEARCH
  • 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 9271397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:36:36+00:00 2026-06-18T15:36:36+00:00

In my jsp page i am having two submit buttons. Code snippet is: <input

  • 0

In my jsp page i am having two submit buttons. Code snippet is:

<input type="submit" name="btnSubmit" id="btnSubmit" value="abc" onclick="return formCheck3(this)"/>
<input type="submit" name="btnSubmit" id="btnSubmit" value="xyz" onclick="return formCheck3(this)"/>

In formCheck3, in javascript, i am validating whether dropdown is selected and then submitting the form.In my method in action class i am having:

String button=request.getParameter("btnSubmit");
if(button.equals("abc")){
//certain code here
}else if(button.equals("xyz")){
//certain code here
}

This is working fine in IE and mozilla but in chrome i am getting the button value as null.
Can anyone suggest me a way around?

  • 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-18T15:36:38+00:00Added an answer on June 18, 2026 at 3:36 pm

    I am doing form.submit() from my javascript and returning true after that

    This is not right. Returning true would continue the invoking element’s default action, which is in case of <input type="submit"> submitting the parent <form> element, which is right, but if you already submit the form beforehand, you’re in essence completely overriding the element’s default action.

    Remove the form.submit() call in your JS. Let the <input type="submit"> do its default job. This way its parameter name/value will also appear in the request parameter map. In your JS, you should control the submission by only returning either true or false.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having this jsp page. <form method=post action=addBook.do?reqCode=submit enctype=multipart/form-data> <input type=file name=myfile /> </form>
I have a jsp page having two text field id and name. Now I
My jsp page <select name=se> <option value=1>D1</option> <option value=2>D2</option> <option value=3>D3</option> </select> While the
I have a drop down in a jsp page having the following code <s:select
I have two iframes added in a jsp page, with same name, display name
How to redirect the value in <s:property/> of one jsp page to the <input
I am having a JSP page, where i am dynamically creating a Table data.
On my JSP page, I defined some javascript with a variable that get value
I have a JSP page where there is a row of buttons in their
I am having four checkboxes in a jsp page. I want to get their

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.