Answered
George_JohnsonCorrect answer
Inspiring
September 20, 2016
You can add the following line after the one that's similar:
getField("private").display = readonly ? display.hidden : display.visible;
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Zac B., Cypress CA
(function () {
// Get one of the fields in the group var f = getField("private.name");
// Determine new readonly state, which // is the opposite of the current state var readonly = !f.readonly;
var readonly_desc = readonly ? "deactivate" : "activate";
// Ask user for password var resp = app.response({ cQuestion: "To " + readonly_desc + " the fields, enter the password:", cTitle: "Enter password", bPassword: true, cLabel: "Password" });
switch (resp) {
case "your_password": // Your password goes here getField("private").readonly = readonly; app.alert("The fields are now " + readonly_desc + "d.", 3); break;
case null : // User pressed Cancel button break;
default : // Incorrect password app.alert("Incorrect password.", 1); break;}
})();