The code posted by punit works.The only problem is that suppose the user clicks 
on submit and for some reason stops the form from submitting through the 
browser controls(it happened with me, some users did it apparently because it 
was taking a long time), then the form would never be submitted again.

-----Original Message-----
From: Puneet Lakhina [mailto:[EMAIL PROTECTED]
Sent: Friday, September 15, 2006 7:14 AM
To: Struts Users Mailing List
Subject: Re: struts issue...


On 9/15/06, Dean, Michael <[EMAIL PROTECTED]> wrote:
>
> Interesting problem...
>
>
>
> I have a submit button which includes a property = "method" with
> value="Save"...the enclosing form is submitted to a Struts
> DispatchAction sub-class which is configured to rely on the "method"
> parameter for delegation.
>
>
>
> In order to prevent a double-submit, in my onSubmit() javascript I
> disable the button and immediately thereafter "return true"....however,
> I proved that the disabling of the button prevents the required method
> parameter from being included in the request...
>
>
>
> I thought about a hidden field but I also established that they ARE NOT
> added to the request upon submission...
>
>
>
> Any ideas?


Ok this is something you could try
<script>
var submitnow = true;
function onSubmitFunction () {
if(submitnow = true) {
    submitnow = false;
     return true;
}else {
       return false;
}
}
</script>

Not sure if this will work. Because I havent tried it.

> Michael Dean
>
> Senior Java Programmer
>
> JIS Applications Maintenance
>
> Information Services Division
>
> Administrative Office of the Courts
>
> 360.704.4008
>
> [EMAIL PROTECTED]
>
>
>
>
>


-- 
Puneet

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to