Thanks Reddy that seems like a good idea. However, that brings me to another problem. On my last page I have two buttons. One that will let me continue with the applicaiton and the other is the button that will bring me back to the original page. Will I need to have two forms and an differnent Action class for each form? Because for each button there is differnt htings happening. CAnI use the same form and Action class for this or will I need a differnet one for each button?

Thanks,

Brian


From: Riyad Kalla <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Clearing Input fields
Date: Wed, 05 May 2004 08:25:52 -0700
MIME-Version: 1.0
Received: from mail.apache.org ([208.185.179.12]) by mc8-f13.hotmail.com with Microsoft SMTPSVC(5.0.2195.6824); Wed, 5 May 2004 08:26:17 -0700
Received: (qmail 56341 invoked by uid 500); 5 May 2004 15:25:55 -0000
Received: (qmail 56324 invoked from network); 5 May 2004 15:25:54 -0000
Received: from unknown (HELO econlab.arizona.edu) (128.196.127.83) by daedalus.apache.org with SMTP; 5 May 2004 15:25:54 -0000
Received: from email.arizona.edu (pcp09138323pcs.pimaco01.az.comcast.net [::ffff:69.136.123.218]) (AUTH: LOGIN rsk) by econlab.arizona.edu with esmtp; Wed, 05 May 2004 08:25:56 -0700
X-Message-Info: JGTYoYF78jGXY/9ZgKXipF35LcMO6Wpa
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Post: <mailto:[EMAIL PROTECTED]>
List-Id: "Struts Users Mailing List" <user.struts.apache.org>
Delivered-To: mailing list [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207)
X-Accept-Language: en-us, en
References: <[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 05 May 2004 15:26:19.0743 (UTC) FILETIME=[50B07EF0:01C432B5]


If it needs to be cleared every time, why not just reset the form before going back to the page? I had a problem similar to this w.r.t. to a login page, it was unsafe because if someone logged out, their login info was automatically populated back into the form. SO if they walked away, another user could walk over and hit enter and login as the person that just left. So I introduced an action that did a forward to the JSP page, but before it did it calls:
form.reset();


then forwards, so the form is always cleared.

Brian Boyle wrote:

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" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>; 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 [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Post: <mailto:[EMAIL PROTECTED]>
List-Id: "Struts Users Mailing List" <user.struts.apache.org>
Delivered-To: mailing list [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]


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:[EMAIL PROTECTED]
> Sent: Wednesday, May 05, 2004 9:40 AM
> To: [EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to