struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pingili, Madhupal" <MPing...@BBandT.com>
Subject RE: Clearing Input fields
Date Wed, 05 May 2004 15:51:43 GMT

I have not tried that. But you can try and let us know if it works.
The Reset button's behavior is resetting form field value to initial value
when we click it.
Even if you clear all form fileds using javascript for onLoad event, it may
still have that value='xxxxx'
as part of html form and when you click on Reset button, it brings back to
initial value.

I like the suggestion made by Robert Tayler to have request scoped form bean
and do a redirect(not forward).
If you have to clear form fields values when you click on reset button on a
error page(when a validation error occurs), 
then you may have to define a global forward with redirect=true and give
that forward name as input for the action.
Try something like that and let us know if it works.

I personally avoid javascript if I have other solutions.

Reddy Pingili


> -----Original Message-----
> From:	Brian Boyle [SMTP:b_boyle18@hotmail.com]
> Sent:	Wednesday, May 05, 2004 11:04 AM
> To:	user@struts.apache.org
> Subject:	RE: Clearing Input fields
> 
> Hi Reddy,
> 
> Thanks for your reply. I understand what you are saying by writing a 
> javascript function for an onClick event. What I would like to know is if
> it 
> is possible to call the function for an onLoad event. Would this function
> be 
> called when the apage is loaded? I would prefer this instead of having to 
> click reset when I return to the page.
> 
> Thanks
> Brian
> 
> 
> >From: "Pingili, Madhupal" <MPingili@BBandT.com>
> >Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
> >To: 'Struts Users Mailing List' <user@struts.apache.org>
> >Subject: RE: Clearing Input fields
> >Date: Wed, 5 May 2004 09:48:15 -0400 MIME-Version: 1.0
> >Received: from mail.apache.org ([208.185.179.12]) by mc8-f19.hotmail.com 
> >with Microsoft SMTPSVC(5.0.2195.6824); Wed, 5 May 2004 06:51:18 -0700
> >Received: (qmail 15274 invoked by uid 500); 5 May 2004 13:50:14 -0000
> >Received: (qmail 15221 invoked from network); 5 May 2004 13:50:14 -0000
> >Received: from unknown (HELO eastgate.bbtnet.com) (208.11.8.3)  by 
> >daedalus.apache.org with SMTP; 5 May 2004 13:50:14 -0000
> >Received: from wil-smtp-av02.bbtnet.com ([10.9.24.60]) by 
> >eastgate.bbtnet.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 5 May
> 2004 
> >09:45:30 -0400
> >Received: from wil-po05.bbtnet.com ([10.9.24.94]) by 
> >wil-smtp-av02.bbtnet.com (SAVSMTP 3.0.0.44) with SMTP id 
> >M2004050509453030262 for <user@struts.apache.org>; Wed, 05 May 2004 
> >09:45:30 -0400
> >Received: by wil-po05.bbtnet.com with Internet Mail Service
> (5.5.2653.19)id 
> ><KJNK7FA2>; Wed, 5 May 2004 09:48:56 -0400
> >X-Message-Info: JGTYoYF78jHlJGzMSQsMqnhJCwOFuF3h
> >Mailing-List: contact user-help@struts.apache.org; run by ezmlm
> >Precedence: bulk
> >List-Unsubscribe: <mailto:user-unsubscribe@struts.apache.org>
> >List-Subscribe: <mailto:user-subscribe@struts.apache.org>
> >List-Help: <mailto:user-help@struts.apache.org>
> >List-Post: <mailto:user@struts.apache.org>
> >List-Id: "Struts Users Mailing List" <user.struts.apache.org>
> >Delivered-To: mailing list user@struts.apache.org
> >Message-ID: <51590A6661CCA24DA46AC8AED9172BB5157E62@wil-po15.bbtnet.com>
> >X-Mailer: Internet Mail Service (5.5.2653.19)
> >X-OriginalArrivalTime: 05 May 2004 13:45:30.0828 (UTC) 
> >FILETIME=[3B4150C0:01C432A7]
> >X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
> >Return-Path: user-return-112644-b_boyle18=hotmail.com@struts.apache.org
> >
> >Hi Brian,
> >If you view the html source, you will see the value='xxxxx'.
> >Clicking on Reset button is initializing to this value for each field.
> >I have solved this problem by replacing Reset button with button and
> >onclick event javascript for that button which will clear all fields.
> >Let me know if you need generic javascript which only needs form name
> >to clear all fields.
> >
> >Reddy Pingili
> >
> >
> > > -----Original Message-----
> > > From:	Brian Boyle [SMTP: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
> >
> 
> _________________________________________________________________
> MSN 8 with e-mail virus protection service: 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


Mime
View raw message