Craig McClanahan wrote:
On 5/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
On 5/11/06, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> On 5/11/06, Jason Vincent <[EMAIL PROTECTED]> wrote:
> According to the HTML specification, disabled input controls
> are *not* included in the request attributes submitted to the server.
> Therefore, disabling the submit button will mean that the request
parameter
> telling the server which button was clicked is not included
Unless Javascript is used for form's data collection and submission.
> I'd look for a strategy involving capturing the *second* click rather
than
> the first one, so you can make sure the original request is submitted
with
> no modifications.
You mean, to resubimit the same request? What is the point?
As I understand it, the goal of the exercise is to *prevent* the second
submit from occurring, while still allowing the first submit to complete
properly.
From what I understand that is the intention. I ran into the same
thing trying to use the "this.enabled = false;" bit of javascript, but I
ran into the same problems as the original poster. The solution I came
up with was to do something like the following (in clay):
<script>
var formSubmitted = false;
</script>
<input type="submit" value="Submit" jsfid="commandButton" onclick="if
(formSubmitted) return false; formSubmitted = true;" />
This will work on commandLinks as well. The javascript that JSF uses
will be put after any that is specified in the onclick javascript, at
least with myfaces. The only thing this doesn't do is change the way
the button is displayed so it also looks disabled. But it does stop the
form from being accidentally submitted by a double click.
Rich
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]