These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Print form with empty required fields

Ciupaz
Registered: Jan 29 2009
Posts: 75

Hi all,
sorry for my dumb question, but why my form can be printed without filling required fields? (fields with a bold red rectangle) and with "User Entered - Required" in "Value" tab.

Thanks a lot.

Luigi

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
The validation of the mandatory fields does not stop the printing process, because it should be possible to print out a blank form and fill it out by hand.

You will have to create your own print button with a validation.

JS for Button click event

if (Form1.Page1.Formfield1.rawValue == null ||
Form1.Page1.Formfield2.rawValue == null ||
Form1.Page1.Formfield3.rawValue == null ||
...
Form1.Page1.Formfieldx.rawValue == null)
{
app.alert({cMsg:"Please fill out the mandatory fields.",cTitle: "More information requiered", nIcon: 1, nType: 0} );
}
else
{
xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
}

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

patra
Registered: Oct 19 2006
Posts: 270
There is any way the alert pop-up window to be specific which field is empty
than the overall message:Please fill out the mandatory fields?

Thanks
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Well, you can add a validation to the exit event of every field, that will cause a pop up window, when the user left the field empty, but that needs code in many fields so it becomes chaotically.

With the validation in the print button event you can delete or add more fields ot the if-condition very easy and you have a good overview about the whole validation process.
I think that's more effective and even better for maintenance of the form.
And, you don't terrorize your customers with so many popups.

By the way, you can of course type your own message to the app.alert box.

Example:
cMsg:"Please fill out the requiered fields.\n\nName\nSurname\nAdress\nZip Code\nCity"

Will be shown:
Please fill out the requiered fields.

Name
Surname
Adress
Zip Code
City

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

lkassuba
ExpertTeam
Registered: Jun 28 2007
Posts: 3636
The first part of [url=http://www.acrobatusers.com/articles/2007/11/101_forms_etips_article]Ted Padova's tip number 77[/url] details how you can check for empty fields and then alerts the end-user if they're not.

Lori Kassuba is an AUC Expert and Community Manager for AcrobatUsers.com.

Ciupaz
Registered: Jan 29 2009
Posts: 75
lkassuba wrote:
The first part of [url=http://www.acrobatusers.com/articles/2007/11/101_forms_etips_article]Ted Padova's tip number 77[/url] details how you can check for empty fields and then alerts the end-user if they're not.
That's good Pdf tutorial, but I cannot download it.

L
Ciupaz
Registered: Jan 29 2009
Posts: 75
Sorry, it's downloadable indeed.

L
Ciupaz
Registered: Jan 29 2009
Posts: 75
I think it's about Mac version. Some menu items I cannot find in my Windows version.

L
lkassuba
ExpertTeam
Registered: Jun 28 2007
Posts: 3636
Ciupaz wrote:
I think it's about Mac version. Some menu items I cannot find in my Windows version.L
Which menus commands are you referring to?

Lori Kassuba is an AUC Expert and Community Manager for AcrobatUsers.com.

Ciupaz
Registered: Jan 29 2009
Posts: 75
lkassuba wrote:
Ciupaz wrote:
I think it's about Mac version. Some menu items I cannot find in my Windows version.L
Which menus commands are you referring to?
I don't find the menu Advanced (pag 40 in the Pdf tutorial).

L
lkassuba
ExpertTeam
Registered: Jun 28 2007
Posts: 3636
The script on page 40 is referring to the Advanced menu located in Acrobat not LiveCycle.

Lori Kassuba is an AUC Expert and Community Manager for AcrobatUsers.com.

ReneG
Registered: Jun 24 2011
Posts: 4
That Ted Padova's script is to check all of the fields.

I just want to check only 4 of the 30 fields in that Form.

Text1,Text2,Text4,Text4 are the names of the fields. The message should come up when the client goes to Print, and should mention which fields need to be filled.

Thanks.

ReneG

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
See the first reply to this thread! That's what you're looking for.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

padobe
Registered: Jun 29 2011
Posts: 10
Hi,

We can also put the same code in the pre-print event of the form :

form1::prePrint - (JavaScript, client)
if (form1.Page1.TextField1.rawValue == null || form1.Page1.TextField2.rawValue == null )
xfa.event.cancelAction = true;