This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes JavaScript form submit fails in IE7, works in FF and Safari Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JavaScript form submit fails in IE7, works in FF and Safari" Watch "JavaScript form submit fails in IE7, works in FF and Safari" New topic

JavaScript form submit fails in IE7, works in FF and Safari

Darth Heizenberg

Joined: May 29, 2003
Posts: 6
I have a test JSF page that I've created with the following piece of code:

The 'scratch' bean points to a class I wrote, that implements java.util.Map and uses a HashMap under the covers. I have system.out's in the get and put methods of this backing bean. I'm using RichFaces 1.2 that's bundled with JBoss 4.2.0GA along with facelets, although this page has no facelets code.
On clicking submit, I find that the put(dummy, +value+) is being called, and the rendering of the page always calls get('dummy'). This happens only in Firefox and Safari, and the text box after the submit contains the value I just set it to. On IE7 however, I only see get('dummy') being called and put is never invoked. Predictably, the text box is empty when the page returns (instead of populated with the value I just entered as it does in Firefox and Safari.

Any ideas why?

Just FYI, I've added the original problem I'm trying to solve, in the previous post.

[ May 06, 2008: Message edited by: Darth Heizenberg ]
Dylan Honorez

Joined: Oct 02, 2006
Posts: 29
I have no clue why it works in FireFox and Opera, I do have a clue what could be wrong:

should be something like

Or is that just the RichFaces way?

Darth Heizenberg

Joined: May 29, 2003
Posts: 6
From what I understand, you could do either one.
Using action="#{bean.methodExpr}" simply submits, then calls the method on the bean, which returns a String specifing what page to forward to.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

"Darth Heizenberg",

Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted.

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Paul Michael
Ranch Hand

Joined: Jul 02, 2001
Posts: 697
I also encountered this problem in IE7. I tried typing in a textfield and then pressed the ENTER button (which does not nothing in IE).

I tested the same procedure with Firefox and the request got submitted.

I'm using MyFaces 1.1.5. I haven't really investigated the problem as it does not bother me that much as of the moment. (I can always click the Submit button explicitly)

Anyway, please keep us posted with your experiments.


SCJP 1.2 (89%), SCWCD 1.3 (94%), IBM 486 (90%), SCJA Beta (96%), SCEA (91% / 77%), SCEA 5 P1 (77%), SCBCD 5 (85%)
I agree. Here's the link:
subject: JavaScript form submit fails in IE7, works in FF and Safari
Similar Threads
Question on jQuery ajax functionality & troubleshooting called bean in JSF page
Questions (1) accessing managed bean directly and (2) using jQuery ajax functionality in my JSF page
Value change listener updating bean
Split Pane effect with JSF 1.2, Facelets, Javascript, RichFaces
Please help - More specific question on JSF + jQuery