Forum Moderators: open

Message Too Old, No Replies

Convert all text to uppercase in Adobe Acrobat text box

Help needed on javascript in Acrobat

         

ronjeremy912

8:05 am on Feb 15, 2005 (gmt 0)

10+ Year Member



I was wondering if anyone has any insight on this...I have a form in Adobe Acrobat with multiple text boxes. What I want to do is take any text that is entered into those text boxes and convert it to all uppercase text, so I can maintain some standard appearance when different people fill out the form.

My programming experience is limited but I think this would require reading the string into an array? then setting up a loop to go through the array and check if the letter was already upper or lower case determined by it's ascii equivalent? On/off track here?

I'm way out of my league here and would like to get this done. Anyone with any input, especially some code examples would be greatly appreciated!

Thanks!
Ron

Bernard Marx

8:20 am on Feb 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not familiar with the Acrobat object model, but I guess you get the string, use the toUpperCase() method to get a new string, then put it back into the box again.

In a browser form this is:

boxRef.value = boxRef.value.toUpperCase();

ronjeremy912

2:44 pm on Feb 15, 2005 (gmt 0)

10+ Year Member



Thanks for the info Bernard. I will try to play around with it today and see if I can get it to work! Sounds alot easier than my original plan!

Bernard Marx

4:15 pm on Feb 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



(My understanding is) PDF Javascript uses the same core language, so all string methods should be present. Any good Javascript reference should do.

How you reference document elements, and get their values etc may be a different matter. For that you'll need to look at the API for the host (Acrobat/PDF).