You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Srinivas Jadcharla <jd...@gmail.com> on 2006/03/28 00:00:39 UTC

Hi there,

Iam here with a request.I need to validate a <html:checkbox (in JSP) using
Struts Validator Framework.I want to make sure that the user checks the
Check Box.if it is not checked validation should fail.Can some one suggest
me which validator i need to use?? I tried *required*
Validator but its not working.
--
Thanks In Advance

JD

Re: Posted by Srinivas Jadcharla <jd...@gmail.com>.
Thanks for your reply.Here is the code iam using in validator.xml


<field property="agree"

depends="required">

<arg0 key="Check Box " resource="false"/>

</field>

Where is the agree is the boolean property in my action form.



On 3/27/06, Dave Newton <ne...@pingsite.com> wrote:
>
> Srinivas Jadcharla wrote:
> > Iam here with a request.I need to validate a <html:checkbox (in JSP)
> using
> > Struts Validator Framework.I want to make sure that the user checks the
> > Check Box.if it is not checked validation should fail.Can some one
> suggest
> > me which validator i need to use?? I tried *required*
> > Validator but its not working.
> >
>
> That's what I use and it's working fine.
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


--
Thanks & Regards
Srinivas
732-648-9421(Cell)

RE: Struts with javascript

Posted by José María Tristán <jt...@sedasolubles.com>.
ok.

Thank you very much.

-----Mensaje original-----
De: Deepa Khetan [mailto:deepa.khetan@gmail.com]
Enviado el: miércoles, 29 de marzo de 2006 11:55
Para: Struts Users Mailing List
Asunto: Re: Struts with javascript


When the HTMl page is rendered on screen, all the struts controls are
rendered as normal HTMl controls. So u can refer them as document.forms
[0].cadenaDesdeText.value.

On 3/29/06, Jose Maria Tristan <jt...@sedasolubles.com> wrote:
>
> Hi:
>
>        I have a text: <html:text property="cadenaDesdeText"
> maxlength="10"/>.
>        I need use this control in a function of javascript.
>        Por example
>        function showText(){
>                alert(cadenaDesdeText);
>        }
>        How can i use any control of struts into a function? How i can
> refer to the
> name of the control?
>
>        Thank you.
>
>
> ---------------------------------------------------------------------
> 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: Struts with javascript

Posted by Deepa Khetan <de...@gmail.com>.
When the HTMl page is rendered on screen, all the struts controls are
rendered as normal HTMl controls. So u can refer them as document.forms
[0].cadenaDesdeText.value.

On 3/29/06, Jose Maria Tristan <jt...@sedasolubles.com> wrote:
>
> Hi:
>
>        I have a text: <html:text property="cadenaDesdeText"
> maxlength="10"/>.
>        I need use this control in a function of javascript.
>        Por example
>        function showText(){
>                alert(cadenaDesdeText);
>        }
>        How can i use any control of struts into a function? How i can
> refer to the
> name of the control?
>
>        Thank you.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Struts with javascript

Posted by Jose Maria Tristan <jt...@sedasolubles.com>.
Hi:

	I have a text: <html:text property="cadenaDesdeText" maxlength="10"/>.
	I need use this control in a function of javascript.
	Por example
	function showText(){
		alert(cadenaDesdeText);
	}
	How can i use any control of struts into a function? How i can refer to the
name of the control?

	Thank you.


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


RE: Posted by Gaurav Jain <ga...@infobeans.com>.
Hi,
This should definitely work. Even I am also using the same and its working
fine.

Gaurav

-----Original Message-----
From: Dave Newton [mailto:newton@pingsite.com] 
Sent: Tuesday, March 28, 2006 3:50 AM
To: Struts Users Mailing List
Subject: Re: <html:checkbox + Struts validation

Srinivas Jadcharla wrote:
> Iam here with a request.I need to validate a <html:checkbox (in JSP) using
> Struts Validator Framework.I want to make sure that the user checks the
> Check Box.if it is not checked validation should fail.Can some one suggest
> me which validator i need to use?? I tried *required*
> Validator but its not working.
>   

That's what I use and it's working fine.

Dave



---------------------------------------------------------------------
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: Posted by Dave Newton <ne...@pingsite.com>.
Srinivas Jadcharla wrote:
> Iam here with a request.I need to validate a <html:checkbox (in JSP) using
> Struts Validator Framework.I want to make sure that the user checks the
> Check Box.if it is not checked validation should fail.Can some one suggest
> me which validator i need to use?? I tried *required*
> Validator but its not working.
>   

That's what I use and it's working fine.

Dave



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