You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kalluru Uma. Maheswar" <Ka...@adeasolutions.com> on 2005/01/10 14:16:02 UTC
Help with DynaActionForm
Hi,
I posted the same question last week but could not get any reply. Can
someone help me please?
How do I validate if a field is entered or not using the DynaActionForm?
My HTML form has <html:text/> and <html:radio/> buttons. I want to check
if the user has entered some text in the text field and that he has
selected the radio button.
If he has not selected, then show him a error message in the jsp. How to
do this? Do I need to configure any xml file for this? An example would
be great.
Thanks
Uma
Re: Help with DynaActionForm
Posted by Pedro Salgado <sa...@04web.com>.
On 10/1/05 2:33 pm, "Uma" <um...@net-kraft.com> wrote:
> But since I am not writing any validate() method, how do my validate() get
> fired? And if I have to show error messages to the user, how do I handle
> this?
don't use DynaActionForm. use DynaValidatorForm. if you specify the rules on
validation.xml it will get fired automatically. it will automatically
generate the javascript and even if the user has disabled javascript, before
the action is executed, the RequestProcessor runs the validation on the
server side and if something goes it forwards to the action input.
try a simple form at first... with only one rule and see what happens.
check the files on attachment ;).
Pedro Salgado
>
> Uma
>
> -----Original Message-----
> From: Pedro Salgado [mailto:salgado.pc@04web.com]
> Sent: Monday, January 10, 2005 5:29 AM
> To: Struts Users Mailing List
> Subject: Re: Help with DynaActionForm
>
>
> check commons-validator.
>
> declare the commons-validator plugin on your struts-config.xml.
> use the validator-rules to specify validation rules (basic copy paste).
> use the validation.xml to specify the rules that apply to which fields on
> a form.
>
> on your jsp use <html:javascript/>.
>
>
> Pedro Salgado
>
> On 10/1/05 2:16 pm, "Kalluru Uma. Maheswar"
> <Ka...@adeasolutions.com> wrote:
>
>> Hi,
>>
>> I posted the same question last week but could not get any reply. Can
>> someone help me please?
>>
>>
>>
>> How do I validate if a field is entered or not using the DynaActionForm?
>>
>>
>>
>> My HTML form has <html:text/> and <html:radio/> buttons. I want to check
>> if the user has entered some text in the text field and that he has
>> selected the radio button.
>>
>>
>>
>> If he has not selected, then show him a error message in the jsp. How to
>> do this? Do I need to configure any xml file for this? An example would
>> be great.
>>
>>
>>
>> Thanks
>>
>> Uma
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
RE: Help with DynaActionForm
Posted by Uma <um...@net-kraft.com>.
But since I am not writing any validate() method, how do my validate() get
fired? And if I have to show error messages to the user, how do I handle
this?
Sorry if my questions are stupid, I am new to struts.
Uma
-----Original Message-----
From: Pedro Salgado [mailto:salgado.pc@04web.com]
Sent: Monday, January 10, 2005 5:29 AM
To: Struts Users Mailing List
Subject: Re: Help with DynaActionForm
check commons-validator.
declare the commons-validator plugin on your struts-config.xml.
use the validator-rules to specify validation rules (basic copy paste).
use the validation.xml to specify the rules that apply to which fields on
a form.
on your jsp use <html:javascript/>.
Pedro Salgado
On 10/1/05 2:16 pm, "Kalluru Uma. Maheswar"
<Ka...@adeasolutions.com> wrote:
> Hi,
>
> I posted the same question last week but could not get any reply. Can
> someone help me please?
>
>
>
> How do I validate if a field is entered or not using the DynaActionForm?
>
>
>
> My HTML form has <html:text/> and <html:radio/> buttons. I want to check
> if the user has entered some text in the text field and that he has
> selected the radio button.
>
>
>
> If he has not selected, then show him a error message in the jsp. How to
> do this? Do I need to configure any xml file for this? An example would
> be great.
>
>
>
> Thanks
>
> Uma
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Help with DynaActionForm
Posted by Pedro Salgado <sa...@04web.com>.
check commons-validator.
declare the commons-validator plugin on your struts-config.xml.
use the validator-rules to specify validation rules (basic copy paste).
use the validation.xml to specify the rules that apply to which fields on
a form.
on your jsp use <html:javascript/>.
Pedro Salgado
On 10/1/05 2:16 pm, "Kalluru Uma. Maheswar"
<Ka...@adeasolutions.com> wrote:
> Hi,
>
> I posted the same question last week but could not get any reply. Can
> someone help me please?
>
>
>
> How do I validate if a field is entered or not using the DynaActionForm?
>
>
>
> My HTML form has <html:text/> and <html:radio/> buttons. I want to check
> if the user has entered some text in the text field and that he has
> selected the radio button.
>
>
>
> If he has not selected, then show him a error message in the jsp. How to
> do this? Do I need to configure any xml file for this? An example would
> be great.
>
>
>
> Thanks
>
> Uma
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org