This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
This does not work, as in the case of a second submission - despite of the "return false" - the form is submitted anyway, and I get duplicate requests.
Second, I tried disabling the button, and that in two different places. First time, in "if" part, after a form.submit(). In that case, there was no form submit at all:
can you show how you are writing your commandButton? it should be like this. Also resubmit should be false initially, not true as you wrote in your post. if it is true initially, then it would never go in the if block.
[ August 28, 2007: Message edited by: Sushma Sharma ]
(One thing I did differently from the websphere example was I put the function in a .js file, while having an included script setting requestSubmitted to false in every jsp page. [Sorry for the mistake about true/false, I meant false of course]. But I think that's not a problem.)
Should that not work the same with onsubmit on the form compared to onclick on the button, or am I making a mistake here?
Joined: Jan 14, 2007
Now that I already posted the former message, I wonder about the "return" in your code:
on click = " return formSubmit()"
As I remember (not being at work now), I have just <h:form onsubmit="formSubmit()"> in my code. Might this be a problem?
Joined: Jun 02, 2005
yeah, return definitely makes difference. I am not sure about the onsubmit of the form. but it should work with that also.