Expand my Community achievements bar.

Font style and Size

Avatar

Level 5

    I would like my text field "values" entered to have the capability to change to Arial 10pt font on a button click. This will allow the entered text to match the font (Arial) of the remaining non-editable fields on the form. I'd like the user to be able to use whatever font style and size they cut and paste from or type in. I would use the previously mentioned button to re-format the font style and size ito Arial 10pt.

I have tried:

ONLICK event:

textfield.font.size = 10 + "pt";

textfield2.font.size = 10 + "pt";

textfield3...............

     None of this is working. Any ideas?

15 Replies

Avatar

Level 2

Do you need a button? If you simply set the font and font size for the textfield using the font window, then whatever text is pasted in will change to that

Avatar

Level 5

It has been my expereince that the Rich Formatting of the text field allows the user to paste any style and size they cut from. So a button would be helpful and prevent the need for me to go from field to field to change the font style and size for each field not Arial 10pt.

Avatar

Level 2

Remove rich text and use plain text on the text field maybe?

Avatar

Level 5

Normally I would agree. But I would like the option for people to use bullet points, italics, bold etc in the text fields. Since the form also goes back and forth between departments it needs some way to comment on text in text fields. However the Comment boxes or ballon text boxes with red arrows and a host of other "Comment" choices are no longer possible in Adobe Acrobat when using LiveCycle to design the form now. So I need the Rich Text so I can enter "red" text to comment on edits that need to be made. Hopefully all of this makes sense.

Avatar

Level 2

If you have a 'textbox1' and a button, set the text box to richtext, then on the buttons click event, change to language to JavaScript and type:

        Textfield1.font.size = "10pt";

Etc,etc...

Avatar

Level 5

Jonathan,

Thank you for the help. For some reason this just doesn't work on my form. On a new blank for it the script will work fine, but not on my already designed form.

Avatar

Level 5

Could you upload your form everywhere?

Avatar

Level 5

Not sure what you are asking.

Avatar

Level 5

Sorry for my english. I mean. Could you upload your PDF that we can take a look on it.

Maybe we will find the mistake in you PDF form.

Avatar

Level 5

Everything works fine!!!!

Your syntax was wrong.

You wrote:

form1.Page1.Document.OnethruTen.FiveThruTen.Seven.SevenDiscovery.font.size = 8;

And you have to write:

form1.Page1.Document.OnethruTen.FiveThruTen.Seven.SevenDiscovery.font.size = "8pt";

You don't read the discussion carefully

Helpful?

Kind regards Mandy

Avatar

Level 5

Mandy,

     Thank you for your help, but no that didn't work. The javascript you wrote is in contridiction to the Adobe document:

http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJS_DesignerJS.pdf

Pg 31. So I am unsure of what the correct scripting reference is.

     When I tried your script it didn't change the format of text entered in the document. It also didn't give a an error message in the console. Thank you.

Pg 31 of Converting......JPG

Avatar

Level 5

Hi,

https://workspaces.acrobat.com/?d=0gf9cm47dclS-TGjnezPRw

when I look for a syntax I use every time F1.

And here you will find:

fontSize.jpg

Here is the english version:

size_eng.jpg

I would therefore recommend the help in LCD. I don't know why.. I know if I start with the LCD I have found a lot of mistakes in the documentation.

I hope my help will help you,

Mandy