Custom Calculation Script vs JavaScript Action
Hello
I want to create a PDF document that only allows the user to edit text fields if they are blank. Once the field is not blank it should not be editable (read-only). This is the code i used for that:
{
var f = this.getField(event.target.name);
if (f.value == "")
f.readonly = false;
else
f.readonly = true;
}
I also have a button that asks for a password, and if the password is correct they can edit a field until they click out of the field.
My issue is that the above code only works if the custom calculation script is set to this. If I take the same code and add a Mouse Up JavaScript Action it does not work correctly. For example if a field is blank i have to click on the field then click out and then click on it again to enter a value. Is there way to focus on the script once i click on it?
The reason I want to have the script in a action rather than a custom calculation script is that i have many fields and pdfs that need to modify. So instead of going to each field individually and pasting the script in the custom calculation script property field i can add select many fields and set the javascript and it will propagate to all the fields selected.
Thanks
Please let me know if i should clarify
