• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Formatting Multiple Fields - PDF

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

So I've got the script figured out (I think) and entered into the document functions tab.  I didn't get any syntax errors, however the script doesn't actually seem to be running anything.  Here is how the code looks, can anyone see why it's not actually doing anything?



Thanks!
 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is only a declaration. You're not calling the function anywhere.
 
Kathleen Tillman
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm pretty new to this so I'm not surprised I missed that.  How do I call the function?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is the $1000 question because we can't tell you that without knowing more about what its purpose is.

The fact that it uses a capital as the first letter conventionally means that this function is meant to be a constructor. But it's not really written as if it were one.

The "this" in the function refers to its function context, and that is set depending upon how it is called. What is it supposed to be?

I think you're going to need to give us more information than just the code of the function in order for us to help you.
 
Kathleen Tillman
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My apologies.  When I originally wrote this, I thought I was just missing something simple.

What I'm trying to do is set a document level script that will automatically find an array of text fields and format them to currency as opposed to having to click on each text field and change the property.  

Everything I read said this was the function to use at the document level.  Basically, I'm trying to save myself a good amount of time since I have an exorbitant amount of fields that require a change to currency format.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We're still missing some context. Is this part of a larger framework that you are using?

What does it mean to "format to currency?"

Where did you get this code from?

And (from your subject), what has this to do with PDF?
 
Kathleen Tillman
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am creating a fillable pdf form. This script came from researching what code could be used to format multiple fields at once. Right now, if I want to update the number format I have to go to each form field’s property tab and update it. I am trying to create a code that will format the fields all at once when they are listed in an array.
 
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We still have no idea of the context in which your function is being used. Are you writing a web application? Are you entering the function into some sort of tool that parses JavaScript? What fields are you referring to? What property tabs? What do they have to do with PDF? Remember that we can't see what's on your screen.
 
Kathleen Tillman
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I’m so sorry. I’m working in PDF. Editor software - Nuance Power PDF.  I put the question here because it’s the closest I could find that related to JavaScript.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic