You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian Boyle <b_...@hotmail.com> on 2004/05/05 15:39:45 UTC

Clearing Input fields

Hi guys!

I was wonderng if anyone could help me with aporblem I have. I input data 
into my input fields on my JSP page. If I press reset the fields are 
cleared. I press submit and my ActoinForm reads the data in and my Action 
processes it etc.... However, when I return to this page again the same data 
is still there in hte input fields. When I press my reset button nothing 
happens. I want to be able to return to the page again and the fields be 
cleared. I don't want to see the same ddata in them.

Any ideas on how to do this?

Thanks for your help

Brian

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus


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


RE: Clearing Input fields

Posted by Robert Taylor <rt...@mulework.com>.
One solution would be to make sure your form is in the request scope (not session)
and that you redirect (not forward) back to the page once you have finished
processing the user input. 

robert

> -----Original Message-----
> From: Brian Boyle [mailto:b_boyle18@hotmail.com]
> Sent: Wednesday, May 05, 2004 9:40 AM
> To: user@struts.apache.org
> Subject: Clearing Input fields
> 
> 
> Hi guys!
> 
> I was wonderng if anyone could help me with aporblem I have. I input data 
> into my input fields on my JSP page. If I press reset the fields are 
> cleared. I press submit and my ActoinForm reads the data in and my Action 
> processes it etc.... However, when I return to this page again the same data 
> is still there in hte input fields. When I press my reset button nothing 
> happens. I want to be able to return to the page again and the fields be 
> cleared. I don't want to see the same ddata in them.
> 
> Any ideas on how to do this?
> 
> Thanks for your help
> 
> Brian
> 
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
> http://join.msn.com/?page=features/virus
> 
> 
> ---------------------------------------------------------------------
> 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: Clearing Input fields

Posted by Hubert Rabago <ja...@yahoo.com>.
Brian,

Aside from putting your form bean in request scope, you really don't need to
do anything special to clear the form when a new form is being shown. 
Javascript certainly isn't required to clear it.  Try it out and mail back if
just putting it to request scope doesn't work as you expected.

Hubert

--- Brian Boyle <b_...@hotmail.com> wrote:
> Hi guys!
> 
> I was wonderng if anyone could help me with aporblem I have. I input data 
> into my input fields on my JSP page. If I press reset the fields are 
> cleared. I press submit and my ActoinForm reads the data in and my Action 
> processes it etc.... However, when I return to this page again the same
> data 
> is still there in hte input fields. When I press my reset button nothing 
> happens. I want to be able to return to the page again and the fields be 
> cleared. I don't want to see the same ddata in them.
> 
> Any ideas on how to do this?
> 
> Thanks for your help
> 
> Brian
> 
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
> http://join.msn.com/?page=features/virus
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

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