-
1. Re: In Acrobat, I wrote a script to turn fields gray if a checkbox was checked. How can I get it to reset to white (or clear) when the reset form button is clicked?
MichaelN Nov 10, 2014 8:47 PM (in response to Nagannudj)The checkbox should have an "if" ... "else" statement, something like:
if checkbox is ticked{
make field gray
}
else {
make field transparent
}
This previous thread has an example:
-
2. Re: In Acrobat, I wrote a script to turn fields gray if a checkbox was checked. How can I get it to reset to white (or clear) when the reset form button is clicked?
Gilad D (try67) Nov 11, 2014 1:21 AM (in response to MichaelN)The problem is that that kind of script is not triggered by the reset form command, Michael.
The solution is to either move the code as the text field's custom validation script, or to create your own Reset Form button that also changes the colors of the text fields when clicked. The latter option will not solve the problem if the user uses the built-in Clear Form command, though.
-
3. Re: In Acrobat, I wrote a script to turn fields gray if a checkbox was checked. How can I get it to reset to white (or clear) when the reset form button is clicked?
Nagannudj Nov 11, 2014 8:48 AM (in response to Gilad D (try67))Thank you so much for your reply . . . but . . . I should have shared my original script with you -- it was a little more complicated than I led you to believer. I was triggering a group of text fields to become disabled as well as gray. Below is the original script so that when the checkbox is checked, it causes several "Co" fields to be disabled and gray.
// Mouse Up script for check box
// If checked, certain fields should be disabled
var f_prefix = "Co";
// Get a reference to all of the "Co" fields
var f = getField(f_prefix);
// Reset the Co fields
resetForm([f_prefix]);
if (event.target.value === "Off") {
// Enable the Co fields
f.readonly = false;
f.fillColor = color.transparent;
} else {
// Disable the Co fields
f.readonly = true;
f.fillColor = color.gray;
}
To recap -- my goal is to get those gray fields to revert to transparent if the form is reset. I'm willing to create my own custom "Reset Form" button but I'm not sure I understand how that would look. Wouldn't it be quite lengthy? I think I'm having a brain freeze -- can't figure it out!



