Skip to main content
Participating Frequently
January 18, 2023
Answered

This.getField Returns refrence error "field name" not defined.

  • January 18, 2023
  • 2 replies
  • 1073 views
var total = this.getField(a1)
console.println(total)
 
When running this code or anyother simple code refrencing text fields its just telling me that my text fields are undefined ive double checked for case changed names tried different fields and nothing is working.  Have used text fields before without issue.
var total = this.getField(a1)
 
console.println(total)
ReferenceError: a1 is not defined
1:Console:Exec
undefined
This topic has been closed for replies.
Correct answer Nesa Nurani

You need to use quotes around a1, like this "a1".

Also if you want to print a field value add  .value like this: var total = this.getField("a1").value

2 replies

Nesa Nurani
Nesa NuraniCorrect answer
Inspiring
January 18, 2023

You need to use quotes around a1, like this "a1".

Also if you want to print a field value add  .value like this: var total = this.getField("a1").value

Participating Frequently
January 18, 2023

Your a life saver i dont know how i didnt remember that thank you!

Bernd Alheit
Adobe Expert
January 18, 2023

What is the field name?