• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Need some assistance on field required before printing is allowed

New Here ,
Mar 03, 2018 Mar 03, 2018

Copy link to clipboard

Copied

Good morning everyone,

I'm in need of some assistance. i'm working on a form for one of my state reps. I have 2 questions that need some scripting help or answers. These forms are not going to be populated for submitting, only for printing. Nothing emailed or nothing saved. They are set to read only so the data is never saved. These forms will be used by multiple locations and multiple users so simplicity is my major concern. However i need to be able to make this work so that if one of the users do not select an option from the dropdown box, and also one for a radio circle, that the form is not allowed to be printed until the information is entered. Now, technically all i really need is the form to be able to display an error message and not let them move on or print until one of the options is selected. In other words it won't allow the form to be printed with the blank values. Must have one of the 5 options selected in order to print the form.

1: how do i made my Date line automatically be put in for the current date when the form is opened without the user doing so.

2: I have a dropdown box created with 5 values in there. I need to be able to have that field be blank when the form is opened. But before it's allowed to print, one of the selections must be entered in from the dropdown box, before any printing can be done. I have tried a few things i have found online but nothing seems to be exactly what i'm needing.

I have ZERO coding knowledge or skills. I only know how to create the forms, make and edit the properties of the fields and make them do some of the functions i need it to do. However, javascripting to me is like reading a foreign language. I haven't the fogiest of what i am looking at or how to write something this simple. I can rebuild an entire car, engine, build a house, design and install all kinds of servers, networks, and security camera systems. I am a network engineer. But a coder i am not. I need some simple help to make this work for my guys to do their jobs. Trying to find someone to do it is nearly impossible as it's for my STATE. We all know how the government doesn't like to take steps in a fast method.

Here is my issue:

Field is labeled : Parts

in my options i have 5 selections including one blank one i made by entered a space and adding it.

(Blank is set as the default value)

Part1

Part2

Part3

Part4

Part5

if there is no part# selected, i want to have either a message pop up and not allow the user to continue, print, or do anything more until one of the 5 parts is made as a selection. Is there any nice people out there that might be able to assist me in this easy solution?

TOPICS
Acrobat SDK and JavaScript , Windows

Views

294

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 04, 2018 Mar 04, 2018

Copy link to clipboard

Copied

1. This can be done using a simple doc-level script.

If the field's name is Today, for example, place this code under Tools - JavaScript - Document JavaScripts:

this.getField("Today").value = util.printd("mm/dd/yyyy", new Date());

2. This is more complicated. Basically you can't prevent the user from printing a file, unless they do so from a button that you add to it.

But the built-in Print command will always be available to them.

What you can do, though, is display an error message or force the printed copy to not include any form data.

To do that you can use this tool I've developed: Custom-made Adobe Scripts: Acrobat -- Validate Required Fields Before Printing or Saving

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 06, 2018 Mar 06, 2018

Copy link to clipboard

Copied

I appreciate the date part, that did work well! TYVM.

But i'm not going to be able to purchase anything in order to do this. Even though that might be extremely close to what i need in ord to accomplish this, the state won't give me authorization to do that. But i do appreciate the help.

If there is anyone else out there that can assist in the second part, please don't hesitate.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 06, 2018 Mar 06, 2018

Copy link to clipboard

Copied

LATEST

I've posted code on these forums for validating required fields (mostly for submitting the file, but it can be used in other contexts as well). You can use it under a Print button that you add to your file to decide whether or not to open the Print dialog, but the user will always be able to do it manually through the File - Print, as I've said before.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines