I have seen code examples using getField
Wanted to try it: So I have a field on my form called nYear
But when I use this code
var nYear = this.getField("nYear").value;
I get the error
this.getField is not a function
2:XFA:myday[0]:Page1[0]:Button1[0]:click
Any ideas why?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
getField is an AcroForm function/script.
To access the value of an object, you can use .rawValue.
I would not be inclined to use the same name for a script variable and an object. So if the object was named 'yearInput' and the script variable 'nYear', the following javascript would achieve what you want:
var nYear = yearInput.rawValue;
Good luck,
Niall
Views
Replies
Total Likes
Hi,
getField is an AcroForm function/script.
To access the value of an object, you can use .rawValue.
I would not be inclined to use the same name for a script variable and an object. So if the object was named 'yearInput' and the script variable 'nYear', the following javascript would achieve what you want:
var nYear = yearInput.rawValue;
Good luck,
Niall
Views
Replies
Total Likes
Views
Like
Replies