The submit button exists on the client. The Action code executes on the
server. Action code cannot reach out and disable a submit button on the
client.

However, you can have the Action decide in advance that the page the browser
will render has its submit button disabled. Consider an ActionForm with a
"submitButtonDisabled" property. The Action could set it to true, and then
the JSP could render the button accordingly. When the browser renders the
plain old HTML produced when the server executes the JSP, it will render the
button as disabled.

If you want this to work more dynamically, perhaps disabling the button
after the user clicks it once, you will need to use something that executes
on the client. JavaScript, for instance. Tokens can also be used to handle
the "user double-clicked the submit button" problem. Struts has token
support built-in. Sometimes, a number of techniques (JavaScript and tokens)
need to be combined to produce the exact behavior desired (or as close as
you can get to it).

This general topic is discussed quite frequently on this list, so it might
be worth searching the mail archive.

-Max

----- Original Message ----- 
From: "hari_s" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 03, 2003 5:26 PM
Subject: how to disabled submit button from action class


> Hi all.
> Is there a way to disabled submit button from action?
> Any examples will be considered.
> Thank you,
>



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

Reply via email to