These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Detecting if a field is read only

StevenD
Registered: Oct 6 2006
Posts: 368
Answered

I'm trying to detect if a field is set to read only or not. Here is the script I have been working with and it is not working.
 
var myFld = getField("Txt.Lockable.DivisionLocation");
if(myFld.readonly === true)
{
app.alert("The field is not locked.");
}
else
{
app.alert("The field is locked.");
}
 
I have been trying to find out what the correct syntax is but cannot find anything. I hope someone can help me out.

StevenD

My Product Information:
Acrobat Pro Extended 9.4, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Accepted Answer
The looks correct, assuming the field name is correct. You might simply want to do this though for testing:

app.alert(getField("Txt.Lockable.DivisionLocation").readonly);
StevenD
Registered: Oct 6 2006
Posts: 368
Thanks for the help. Your line of code helped kick me in the direction I needed to go.

StevenD