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 7497863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:15:11+00:00 2026-05-29T19:15:11+00:00

I have 2 <h:form> elements following each other (not one within the other) such

  • 0

I have 2 <h:form> elements following each other (not one within the other) such as :

<h:form id="innerHeaderForm1">
    <h:inputText value="#{searchBar.eventname}" />
    <h:commandButton action="#{searchBar.search1}" value="click1"/>
</h:form>
<h:form id="innerHeaderForm2">
    <h:inputText id="last" value="#{searchBar.personname}"/>
    <h:commandButton action="#{searchBar.search2}" value="click2"/> 
</h:form>

This works fine. The problem I have is that in IE 8 (and I’m assuming other older versions) when in the first form and I hit the “enter” key on my keybord, the form is not submitted. The page reloads, but does not even call #{searchBar.search1}.

The odd thing in all this is that this works fine in the second form. I don’t get an error message nor do I get any feedback from the browser.

In my backing bean I have something of the sort :

public String search1() {
    System.out.println("submitting form1");
    return "success";
}

public String search2() {
    System.out.println("submitting form2");
    return "success";
}

When using hitting the “enter” key, I don’t even make it to the backing bean.

But : when I do “click” the submit button (with the mouse) everything works.

Any insight on this would be greatly appreciated!

  • 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-05-29T19:15:13+00:00Added an answer on May 29, 2026 at 7:15 pm

    This is a MSIE specific anomaly in case of forms with only one <input type="text"> field. The only fix is to add another <input type="text"> field which is hidden by CSS display: none;.

    <h:form id="innerHeaderForm1">
        <h:inputText value="#{searchBar.eventname}" />
        <h:inputText style="display: none;" />
        <h:commandButton action="#{searchBar.search1}" value="click1"/>
    </h:form>
    

    This problem is not related to JSF.

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

Sidebar

Related Questions

I have a simple MVC form with the following elements: <%= Html.TextBox(FechaInicio) %> Which
I have the following problem. I’ve made a form which change the form elements
Please help! I have some form elements in a div on a page: <div
OK, another road bump in my current project. I have never had form elements
This week I have figured out how to modify form elements in the location
About to create a form using Zend Form, all the form elements should have
I have a form which contains a lot of elements, my DB guy has
I have a form that when submitted successfully generates new elements on the page
I have 4 <select></select> elements in my form. Usually when submitting the form you
I have a form element that contains multiple lines of inputs. Think of each

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.