-
1. Re: Calculated field hidden when field is blank
GKaiseril Sep 10, 2013 1:51 PM (in response to lmphil)If the field is formatted as a number with no currency symbols, you can set the field value to the null string, "". Newer versions of Acrobat now surpress the zero values for calculated fields.
-
2. Re: Calculated field hidden when field is blank
George_Johnson Sep 10, 2013 1:52 PM (in response to lmphil)If you want to supress a display of zero in a formatted field, just set up the formatting as you want it and use the following for the field's custom Validate script:
// Custom Validate script
if (+event.value === 0) event.value = "";
-
3. Re: Calculated field hidden when field is blank
lmphil Sep 10, 2013 2:04 PM (in response to GKaiseril)Thanks for your input. I am using Acrobat X. I understand what about setting the default value to ""; however, when I tried this, I got the following error:
"This default value does not match the format (Number) specified. Please enter a default value that matches the format or change the format in the Format panel to match this default value."
Any suggestions?
-
4. Re: Calculated field hidden when field is blank
GKaiseril Sep 10, 2013 2:30 PM (in response to lmphil)What is the format for the field?
You could always use a format of "none" and use the util.printf method to format the numeric values but this could cause issues if you use the value in another field's calculation.
-
5. Re: Calculated field hidden when field is blank
lmphil Sep 11, 2013 6:16 AM (in response to GKaiseril)Thanks again for your input. These fields are used for calculation,so I understand why changing the format to "none" could cause problems. There's no way to tweak the script posted in my original discussion to make it work in this situation? Like I posted earlier, I actually got the show/hide to work. The formatting is just off. I need a comma at the thousand and two places after a decimal point. Thanks in advance for your help.
-
6. Re: Calculated field hidden when field is blank
GKaiseril Sep 11, 2013 8:16 AM (in response to lmphil)Make sure you are using the correct quotation marks. Use either the double quotation marks or the single quotation marks and not 4 single quotation marks.
if(event.value == 0) {
event.value = ''; // set field to null (2 single quotation marks);
Supress Zero
-
7. Re: Calculated field hidden when field is blank
lmphil Sep 11, 2013 8:26 AM (in response to GKaiseril)That's it!!! Worked beautifully! Thank you!



