Copy link to clipboard
Copied
Hello all,
I'm trying to make a fillable form where the front desk reps fill out a certain portion of the form and then the form is sent to patients to sign and fill out. To avoid patients from editing what the front desk has filled out im trying to make a button that locks the fields to read only. I have the code to set the text field to read only but I would like the text fields to be editable again if the button is unchecked in case the front desk needs to go back and fix something. Is this possible? The code I have for the button to set it to read only is this.getField("FieldNameHere").readonly = true;
Thank you for any help!
Assuming it's a check-box field, and you've placed the script udner its Mouse Up event, you can adjust your code like this:
this.getField("FieldNameHere").readonly = (event.target.value!="Off");
Copy link to clipboard
Copied
Assuming it's a check-box field, and you've placed the script udner its Mouse Up event, you can adjust your code like this:
this.getField("FieldNameHere").readonly = (event.target.value!="Off");
Copy link to clipboard
Copied
Yes, it is a check-box field. Aplogies I should have been more clear. This worked perfectly!
Thank you!
Copy link to clipboard
Copied
Thank you for your help. I just have one more question. Is there a code that locks that check box button after it has been saved?
Copy link to clipboard
Copied
What has been saved? The file? If so, you should do it just before it's saved, not after.
To do it go to Tools - JavaScript - Set Document Actions and under the Document Will Save event enter the following code:
this.getField("FieldNameHere").readonly = true;
Copy link to clipboard
Copied
I'm trying to do something somewhat similar but need a button to unlock certain fields. I also need this button password-protected or something. I need people to fill out the top portion first and have some form fields at the bottom locked for certain personnel. Is there a code to put a password on the button and have that button turn off read-only for those certain fields?
Copy link to clipboard
Copied
You can do it using something like this:
if (app.response("Enter password to unlock fields:", "", "")=="1234") {
this.getField("Field1").readonly = false;
this.getField("Field2").readonly = false;
this.getField("Field3").readonly = false;
} else app.alert("Wrong password!");
Notice the correct password is hard-coded into the script as plain-text ("1234" in the code above), so it's extremely unsecure...
Copy link to clipboard
Copied
That worked beautifully, can you provide code for making the button reverse the "AGI admin personnel signature" and "Decision" fields being set to the read-only using the button?