You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Deffenbaugh <jd...@techtarget.com> on 2007/10/04 17:07:58 UTC
s:select onchange and validation
Hello,
I have two s:select drop downs on my page, lets call them x and y. When
I change the value of x I populate y using the onchange attribute
calling a javascript function. If the user then tries to submit the
form with errors my validation kicks in and refreshes the page showing
the field errors etc. but I lose the data I populated in y via my
javascript function. Is there a way to save the state of y in this
scenario without struts repopulating the s:select with what is in its
list attribute?
Hope that makes sense.
-Jason
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: s:select onchange and validation
Posted by Jason Deffenbaugh <jd...@techtarget.com>.
I just used a hidden field to save the index. Easier way?
-Jason
On Thu, 2007-10-04 at 11:07 -0400, Jason Deffenbaugh wrote:
> Hello,
>
> I have two s:select drop downs on my page, lets call them x and y. When
> I change the value of x I populate y using the onchange attribute
> calling a javascript function. If the user then tries to submit the
> form with errors my validation kicks in and refreshes the page showing
> the field errors etc. but I lose the data I populated in y via my
> javascript function. Is there a way to save the state of y in this
> scenario without struts repopulating the s:select with what is in its
> list attribute?
>
> Hope that makes sense.
>
> -Jason
>
>
> ---------------------------------------------------------------------
> 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