Copy link to clipboard
Copied
Hi I am noticing different behaviour on my ipad vs my windows machine on some code I created. This gives text a numeric value and adds them up. The pic below is on my windows machine which assigns a value of 1 to the text in the colums and places it on the bottom.
This shot below is on my ipad which does nothing at all! I a bit confused as to why?
my code is below, which works well, (it just adds up the texts boxes)
var fields = ["Text1", "Text2", "Text3", "Text4", "Text5", "Text6", "Text7", "Text8", "Text9", "Text10", "Text11", "Text13", "Text14", "Text15", "Text16", "Text17", "Text18", "Text19", "Text20", "Text21", "Text22", "Text23", "Text24", "Text25", "Text26", "Text27"];
var count = 0;
for (var i=0; i<fields.length; i++) {
var f = this.getField(fields[i]);
if (!/^\s*$/.test(f.valueAsString)) count++;
}
event.value = count;
Wondering if anyone has some ideas? thanks!
Copy link to clipboard
Copied
Acrobat Reader for iOS and Android doesn't support all javascript features.
Copy link to clipboard
Copied
Don't use "f.valueAsString" in your evaluation script.
Instead of using this line:
(!/^\s*$/.test(f.valueAsString))
change it to: (!/^\s*$/.test(f.value))
In addition, as mentioned by Bernd Alheit, some features may not work in the iOS or Android mobile versions of Adobe Reader.
Even though the form may calculate correctly with the change in the script suggested above, the built-in "Reset" feature, for example, won't clear the fields automatically.
You need to add a "MouseUp" trigger event button with a "Reset a form" action for your users.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Check the fields calculation order.
Copy link to clipboard
Copied
That did it! Thanks! I re-arranged the order with the text box sum 1st. Just wondering why that matters as I had the text box 3rd in order before?
Copy link to clipboard
Copied
You're welcome. Happy to read that you were able to get it to work.
There is a good explanation on why the field calculation order matters here:
Copy link to clipboard
Copied
Hi the behaviour has gone back to the way it was https://www.loom.com/share/3f060e7da0764a3aa70d8ec10ae6f640
Not sure what is going on here? thanks for any help.