On an interactive form, is there a way to require that certain fields be filled in? We have inspection forms that must be filled out properly and the desire is to not allow saving or printing the form unless certain fields have been filled in/checked/whatever.
Announcement
Collapse
No announcement yet.
Required Fields
Collapse
X
-
Tags: None👍 1
-
Post_Foxit Your requirement can be accomplished by Javascript. Can you please give me your email address and I can send demo file with JS to you for reference? Also, you can send email to us via [email protected]
Thanks.👍 1 -
-
Post_Foxit Hi, the email with demo file was sent to you. Please check and let me know your idea, thanksComment
-
Hi there, can I please get the information on how to do this as well? My email is [email protected]. Thank you!Comment
-
A user may have many good reasons for wanting to save or print a form before having finished filling it out (announced power cut, appointment, interruption, emergency, etc.).
Luckily for him you can't prevent him from saving or printing.
It is much more user-friendly to just display an alert when the user is saving or printing.Comment
-
Hi there, can I please get the information on how to do this as well? My email is [email protected]. Thank you!
1. Open the document in Foxit PDF Editor.
2. Click on the Form Fields panel on the left nav.
3. Right click on the form to be required.
4. Under General Tab, check the > Required < checkbox.Comment
-
Here is what I do:- Create a Document JavaScript Function called Required with the following code.
Code:function Required() { var c = 0; for (var i = 0; i < this.numFields; i++) { var fieldName = this.getNthFieldName(i); var f = this.getField(fieldName); if (f.type != "button") { if (f.required == true && (f.value == "" || f.text == "")) { c++; } } } if (c > 0) { app.alert("At least one required field is empty...",1); c = 0; } return; }
- Then simply called the function with Code:
Required();
EDIT: do not use JS6 code, such as "let" or "const"; use "var." I have made this replacement in my code above.Last edited by cwb162; 03-01-2022, 03:44 PM.Comment
-
cwb162
Thanks for the details. The mentioned two discoveries have been submitted to Foxit internal bug tracking system for our JS engineer's further investigation and we'll keep you posted with the update. You may also use the Report ID#QCPHANTOM-29435 to track the processing status any time. Thank you.
Comment
-
cwb162
Thanks for the details. The mentioned two discoveries have been submitted to Foxit internal bug tracking system for our JS engineer's further investigation and we'll keep you posted with the update. You may also use the Report ID#QCPHANTOM-29435 to track the processing status any time. Thank you.Last edited by cwb162; 03-01-2022, 03:49 PM.Comment
Comment