PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
Leo,
I agree with Jim that assigning a field the property "Required" will result
in a message informing the user if that field has been left blank, if and
when the user submits the data to a web server.
But because our forms generally do not submit the data to a web server, I
have written JavaScript to check for blank fields,
As a matter of course, we always include the following buttons (among
others) on our forms: "Save Data", "Print", and "Email Form". Because
these three buttons are the ones that the user might select upon completion
of the form, I place the logic to check for blank fields in the "Mouse Up"
action for these buttons.
Here are two examples:
// This code would be added to a "Print" button created by the forms
designer.
var f1 = this.getField("SSNUM");
var f2 = this.getField("TIMEPM");
if (f1.value == "")
{app.alert("Social Security Number is a required field!")
if (typeof app.formsVersion != "undefined" && app.formsVersion >=
4.0)
// Version specific operation:
f1.setFocus();}
else
{
if (f2.value == "")
{app.alert("Time is a required field!")
if (typeof app.formsVersion != "undefined" &&
app.formsVersion >= 4.0)
// Version specific operation:
f2.setFocus();}
else
app.execMenuItem("Print");
}
Or
// Enumerate through all of the fields in the document.
for (var i = 0; i < this.numFields; i++)
{
var f1 = this.getField(this.getNthFieldName(i));
if (f1.value == "")
{
// app.alert(this.getNthFieldName(i) + " is a required
field!")
// Display the "Short Description" rather than the possibly
cryptic field name.
app.alert(f1.userName + " is a required field!")
if (typeof app.formsVersion != "undefined" &&
app.formsVersion >= 4.0)
// Version specific operation:
f1.setFocus();
}
}
-----Original Message-----
From: Wong, Leo K. [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 18, 2003 3:59 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PDF-Forms] Check for Unfilled Fields: Leo (2)
PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
Hello Jim. I wasn't thinking from my standpoint (the creator of the field
fillable form), but from the end user's standpoint. The end user has many
fields to complete and wants to know if he/she has missed completing any
fields.
-----Original Message-----
From: efoview spt [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 18, 2003 2:51 PM
To: [EMAIL PROTECTED]
Subject: Re: [PDF-Forms] Check for Unfilled Fields
PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
You don't need the javascript. You only have to check the "Required" check
box when laying out fields.
Jim Su
[EMAIL PROTECTED]
EFOVIEW
###
>From: "Wong, Leo K." <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: [PDF-Forms] Check for Unfilled Fields
>Date: Thu, 18 Sep 2003 14:10:09 -0500
>
>Hello to all.
>
>
>
>I require a JavaScript I can assign to a button that a person can click to
>see if there are any fields that he/she forgot to complete, i.e., he/she
>missed typing in information. Thanks!
>
>
>
>Leo
>
_________________________________________________________________
Send and receive larger attachments with Hotmail Extra Storage.
http://join.msn.com/?PAGE=features/es
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html