Hello everyone,
First of all, I apologize for my poor English (I'm Italian).
I'm a newbie and have a question for those more experienced than me (so basically all of you):
I have a PDF file (it's a booking form for bungalows at a campsite) that I need to distribute to customers.
The customer must fill out a series of fields (text forms).
One of these forms contains the total price of the stay, which we enter before sending the file to the customer.
Since we use different devices to send files to customers (tablets, cell phones, etc.), it's not always possible to open the file with a PDF editor.
Would it be possible (for example, with Javascript) to allow modification of a single form only by entering a password, thus preventing the customer from changing the amount?
Thank you in advance for your time and attention.
Text module editable only with password
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Stefan - PDF-XChange
-
- User
- Posts: 2
- Joined: Tue Aug 12, 2025 2:37 pm
-
- Site Admin
- Posts: 7388
- Joined: Wed Mar 25, 2009 10:37 pm
Re: Text module editable only with password
Hi, davide.guerretta
thanks for the post and excellent question.
Indeed, filling the forms should work on any device, and you can add a password with the option to allow form filling. But I think you want to lock and prevent the total being changed, but still allow other form fields to be modified.
Is that right?
You could add your price, then set that specific field to "Read Only, then password protect the document allowing Form filling. They should be able to fill the other fields but only read that total.
Is that what you are looking for?
thanks for the post and excellent question.
Indeed, filling the forms should work on any device, and you can add a password with the option to allow form filling. But I think you want to lock and prevent the total being changed, but still allow other form fields to be modified.
Is that right?
You could add your price, then set that specific field to "Read Only, then password protect the document allowing Form filling. They should be able to fill the other fields but only read that total.
Is that what you are looking for?
Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
-
- User
- Posts: 2
- Joined: Tue Aug 12, 2025 2:37 pm
Re: Text module editable only with password
First of all, thank you so much for your reply.
But I need a different solution... Let me explain.
This form will be sent to customers in most cases from a mobile phone. The procedure you suggested instead requires me to open the file with the editor, enter the price, and then protect it with a password, which I don't think is possible from a mobile phone (or at least it would be decidedly impractical).
I was wondering if it would be possible to have only the form containing the price password-protected so that when someone clicks on that form to enter/edit a price, they'll be asked for a password to proceed. This way, even from a mobile phone and without using an editor, but only a reader, the operator would be able to quickly and easily edit the file to send to the customer... I know it's possible to do this in an HTML page with Javascript, but I don't know if it's possible for a single form in a PDF file.
Hoping I've been more clear, thank you in advance.
P.S.: I'd like to take this opportunity to point out what I believe to be a couple of critical issues with your excellent software (since I deal with problem solving professionally, it's a professional deformation):
- I've attached an example file showing how in some cases (when there's an accented letter), if I highlight or underline text, which I personally do often because I find it very convenient, the layout appears "incorrect," with different spacing for highlighting and a thicker line weight for underlining. It's a shame, and I don't think it would be difficult to fix.
- Speaking of Modules & JavaScript, I haven't found a guide: it could be very practical to create one that allows you to have at least a general idea to be able to implement very useful functions in PDF files: from mathematical operations to solutions to particular situations like the one I described to you.
But I need a different solution... Let me explain.
This form will be sent to customers in most cases from a mobile phone. The procedure you suggested instead requires me to open the file with the editor, enter the price, and then protect it with a password, which I don't think is possible from a mobile phone (or at least it would be decidedly impractical).
I was wondering if it would be possible to have only the form containing the price password-protected so that when someone clicks on that form to enter/edit a price, they'll be asked for a password to proceed. This way, even from a mobile phone and without using an editor, but only a reader, the operator would be able to quickly and easily edit the file to send to the customer... I know it's possible to do this in an HTML page with Javascript, but I don't know if it's possible for a single form in a PDF file.
Hoping I've been more clear, thank you in advance.
P.S.: I'd like to take this opportunity to point out what I believe to be a couple of critical issues with your excellent software (since I deal with problem solving professionally, it's a professional deformation):
- I've attached an example file showing how in some cases (when there's an accented letter), if I highlight or underline text, which I personally do often because I find it very convenient, the layout appears "incorrect," with different spacing for highlighting and a thicker line weight for underlining. It's a shame, and I don't think it would be difficult to fix.
- Speaking of Modules & JavaScript, I haven't found a guide: it could be very practical to create one that allows you to have at least a general idea to be able to implement very useful functions in PDF files: from mathematical operations to solutions to particular situations like the one I described to you.
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 11586
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Text module editable only with password
Hello, davide.guerretta
You could use JS to mark or unmark a field as read only, but offering a password prompt to do so would not be secure, and most importantly... Mobile devices, and the vast majority of mobile apps for that matter, do not fully understand the PDF Specification and many have no capacity to allow document JS to run, meaning those who do need to fill this in would much more likely encounter one of these issues from this process.
Regarding your secondary items.
Kind regards,
You could use JS to mark or unmark a field as read only, but offering a password prompt to do so would not be secure, and most importantly... Mobile devices, and the vast majority of mobile apps for that matter, do not fully understand the PDF Specification and many have no capacity to allow document JS to run, meaning those who do need to fill this in would much more likely encounter one of these issues from this process.
- The field cannot be interacted with because it is locked, and JS cannot run in that application.
- The file can be changed despite the lock, because the app does not understand the Spec, and the resultant document might be damaged (possibly leading to data loss or corruption).
Regarding your secondary items.
- I will pass the underline/highlight sample along to the Dev team for review, though I cannot promise any changes there. The size of those items is intentionally based on the Font in question's reported size, so when factors cause that to change, these items are intended to change to encompass that. Perhaps there is a workaround, but I can assure you that it will not be an easy fix.
- As for a guide to JS, there is... alot, which can be done using the language, and generally, the expectation is that you are coming into it with a full understand of JS before you start using it in PDF context. As such, the following reference manual builds on the basics of JS, with special conformance to what is supported by most capable PDF software: https://opensource.adobe.com/dc-acrobat ... croJS.html
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com