You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Heidy Gutiérrez Guzmán <he...@gmail.com> on 2006/09/12 20:43:28 UTC
validate an html:multibox and show messages in the own page
Hi
I'm using the <html:multibox /> struts tags.
I need validate the total of "checked" that have been selected.
I can do that with java script code, but i need put a var in the session
scope with the purpose of show the error message later, and that, i can not
do that with the java script code.
If anybody could help me...
Thanks
Re: validate an html:multibox and show messages in the own page
Posted by Laurie Harper <la...@holoweb.net>.
Heidy Gutiérrez Guzmán wrote:
> Hi
>
> I'm using the <html:multibox /> struts tags.
> I need validate the total of "checked" that have been selected.
> I can do that with java script code, but i need put a var in the session
> scope with the purpose of show the error message later, and that, i can not
> do that with the java script code.
I'm not sure I understand your question. No, you can't access the
session from Javascript, since the session lives on the server and the
Javascript runs in the browser. However, any validation you code in
Javascript should be backed by server-side validation (in case the user
has turned Javascript off).
Your client-side validation can present the error message however it
likes; your server-side validation can use the standard saveMessages()
approach.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org