-----Original Message-----
From: Marston, David [mailto:[EMAIL PROTECTED]
Sent: March 22, 2004 7:03 AM
To: Pdf-Forms (E-mail)
Subject: [PDF-Forms] Reset fieldsHi,
I am trying to find a way to clear all fields when a document closes. I would like to do it on an exit button which closes the document and at the same time clears any fields where data has been entered.
I've tried the following using a document level _javascript_ clear fields function - which I call on a button mouse up.
function ClearFields ( )
{
var a = this.getField("Customer Name")
a.value = ""
var b = this.getField("Salesperson Name")
b.value = ""
var c = this.getField("Location")
c.value = ""I've called this from the mousedown, and the menu item "exit" on the mouse up. But 1. I get the do I want to save changes dialogue box (which I would rather not have) and the clear fields doesn't work!!!
What's the best way to achieve this?
Thanks, David.
Title: Message
You
can use the this.resetForm(); function in your _javascript_. Unless
otherwise specified, you will return all of your fields to their default state
(usually blank).
If you
wanted to control only some of the fields in this way, you would have
to use the Naming Convention and precede all said fields with something like
"wLock". So "name.first" would become "wLock.name.first". Now, you
can reset all of those fields (and only those fields) like
this:
var a
= new Array(1);
a[0] =
"wLock";
this.resetForm(a);
Mark
P.S.
in regards to the "Save As" dialogue, look into the "dirty"
parameter.
- [PDF-Forms] Reset fields Marston, David
- Re: [PDF-Forms] Reset fields Andrew Clark
- Re: [PDF-Forms] Reset fields JR Boulay
- RE: [PDF-Forms] Reset fields Lauterbach.Mark
- RE: [PDF-Forms] Reset fields Marston, David
