Skip to main content
amplogho
Participating Frequently
February 8, 2023
Answered

Form Fields

  • February 8, 2023
  • 1 reply
  • 848 views

I am fairly new to creating form fields and I am wondering if there are ways to do two things. The first thing I want to do is to attach a user name to a form field. For example, if someone fills out a calendar date for when a bill got sent out, Adobe will automatically attach their name to the filled field. Hopefully the name isn't visible without clicking on the field to check who filled in that part of the form.

The second thing I would like to accomplish is to disable a field if another field does not have the requisite key words. For example, if I have a date field for when money was moved from liability to revenue, that field is not active unless the invoice type contains the word "retainer". Thanks!!

This topic has been closed for replies.
Correct answer try67

- There's no built-in option to do it, but it might be possible with a custom-made script. However, accessing the user-name is tricky and might require installing a script on the local machine of each user.

- Yes, that's certainly possible. For example, you can use this script as the custom calculation script of "Text2" to make it only editable if "Text1" contains the word "retainer":

if (/retainer/i.test(this.getField("Text1").valueAsString)) {
	event.target.readonly = false;
} else {
	event.target.readonly = true;
	event.value = "";
}

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
February 8, 2023

- There's no built-in option to do it, but it might be possible with a custom-made script. However, accessing the user-name is tricky and might require installing a script on the local machine of each user.

- Yes, that's certainly possible. For example, you can use this script as the custom calculation script of "Text2" to make it only editable if "Text1" contains the word "retainer":

if (/retainer/i.test(this.getField("Text1").valueAsString)) {
	event.target.readonly = false;
} else {
	event.target.readonly = true;
	event.value = "";
}
amplogho
amploghoAuthor
Participating Frequently
February 9, 2023

Thank you! That script was perfect.