You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "yuensunlam@yahoo.com" <yu...@yahoo.com> on 2003/11/24 23:14:24 UTC

disable submit button unless all required fields are filled

Hi,
 
I want to have the submit button disabled unless the required text field is filled by the user. I have two buttons in the form, submit and cancel. The cancel button should always be enabled. Can anybody help me? Please!
 
Thanks in advance!


---------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

Re: disable submit button unless all required fields are filled

Posted by Brice Ruth <br...@fiskars.com>.
How about having JavaScript only perform submission of the form when all 
fields are entered (using validation) ... that would make a bit more 
sense. Otherwise, you'd have to put a method in the handlers for every 
field that fires when that field loses focus, to determine if the submit 
button should be enabled ... you'd be opening yourself up for a 
nightmare of maintenance ...

yuensunlam@yahoo.com wrote:

>Hi,
> 
>I want to have the submit button disabled unless the required text field is filled by the user. I have two buttons in the form, submit and cancel. The cancel button should always be enabled. Can anybody help me? Please!
> 
>Thanks in advance!
>
>
>---------------------------------
>Do you Yahoo!?
>Free Pop-Up Blocker - Get it now
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org