You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vandenbroucke Gregory <gr...@dad.be> on 2005/07/25 11:29:04 UTC
Resetting ActionForm properties during validation
Hi all,
I have several forms which contain fields that should only accept numeric
data. If the entered data wasn't numeric, then during validation of that
field I would like to be able to leave the form field empty. But struts will
auto populate all fields. Meaning that for numeric fields it will enter
zero's if the entered data wasn't numeric.
Is there any way to circumvent this, and leave the form fields empty if the
entered data wasn't correct?
TIA,
Gregory.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Resetting ActionForm properties during validation
Posted by Kjersti Berg <kj...@gmail.com>.
On 25/07/05, Vandenbroucke Gregory <gr...@dad.be> wrote:
> Hi all,
>
> I have several forms which contain fields that should only accept numeric
> data. If the entered data wasn't numeric, then during validation of that
> field I would like to be able to leave the form field empty. But struts will
> auto populate all fields. Meaning that for numeric fields it will enter
> zero's if the entered data wasn't numeric.
> Is there any way to circumvent this, and leave the form fields empty if the
> entered data wasn't correct?
Are your your form fields strings? If so the user's input will be kept
even if validation fails. If they are ints you get a 0 instead,
because that is that that is the default value of an int.
Kjersti
>
> TIA,
> Gregory.
>
>
> ---------------------------------------------------------------------
> 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