You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sairam manda <ma...@hotmail.com> on 2003/11/12 10:44:17 UTC

validation

Hello Sir,
I am new to struts .I have a question in validating a form . My form has a 
checkbox and few textfields corresponding to the checkbox  ie I want to 
validate  these textfeilds only if the checkbox is checked .
Can anybody guide me how I can do this using requiredIf validation.
regards
sairam

_________________________________________________________________
Express your Digital Self. Win fabulous prizes. 
http://www.msn.co.in/DigitalSelf/ Enter this cool contest.


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


Re: validation

Posted by "Garg Raman (SDinc)" <ra...@smartdatainc.com>.
public ActionErrors validate(ActionMapping mapping,
                                HttpServletRequest request)
   {

   ActionErrors errors = new ActionErrors();
    if((checkbox!=null)){
       if((text1==null) || (text1.equals(""))){
       errors.add("text1", new ActionError("error.text1.required"));}
    }

     return errors;
   }


 Hope this may help you


Cheers
Raman Garg  , Gary
ramang@smartdatainc.com
gurpreetd@smartdatainc.com




----- Original Message -----
From: "sairam manda" <ma...@hotmail.com>
To: <st...@jakarta.apache.org>
Sent: Wednesday, November 12, 2003 3:14 PM
Subject: validation


> Hello Sir,
> I am new to struts .I have a question in validating a form . My form has a
> checkbox and few textfields corresponding to the checkbox  ie I want to
> validate  these textfeilds only if the checkbox is checked .
> Can anybody guide me how I can do this using requiredIf validation.
> regards
> sairam
>
> _________________________________________________________________
> Express your Digital Self. Win fabulous prizes.
> http://www.msn.co.in/DigitalSelf/ Enter this cool contest.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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