Expand my Community achievements bar.

I want form to open with fields automatically highlighted.

Avatar

Level 1

I am creating a form that, when opened, I want the fill-in fields to automatically be highlighted. When I open the form in Acrobat, there is checkbox at the upper right side to check - it says "Highlight Fields" - by default, it is not checked.  Is there a way to have it checked when the user opens the form?

Thanks!

9 Replies

Avatar

Former Community Member

Yes ..add th ecommand app.runtimeHighLight = true to the Form Ready event and it will be on for you.

paul

Avatar

Level 1

How would I do that? sorry, I am one of those that uses the drag and drop, cut and paste.

I tried to cut and paste the command you provided in the Script Editor, but it didn't work for me.  the form:ready option is only available if I am selecting something on the form....

Avatar

Former Community Member

In the hierarchy view ...click on the top node (fom1 by default).. now in th escript editor on th etop left you can choose an event to script against. Choose the formeady in the dropdown. Now on the 1st available line type the code.

Thats it.

Paul

Avatar

Level 1

This is what I am doing:

In Hierarcy I have 'form1' selected.
I selected 'form:ready' and typed in "app.runtimeHighLight = true"
for Language it is defaulted at 'FormCalc' and Run At is defaulted at 'Client'

I am getting an error message that reads:


Script failed (language is formcalc; context is xfa[0].form[0].form1[0])

script=app.runtimeHighLight = true

Error: accessor 'true' is unknown.

??

Any suggestions on how to fix this?

Avatar

Level 1

I did try that yesterday (I changed the drop down menu from

FormCalc to JavaScript).  It didn't work - right away - and I didn't save my work, but about 5 or 10 minutes later the form did start opening with the fields highlighted...without the code...
What's strange is that every form I opened after that (forms I didn't create) was defaulted as highlighted.

I emailed the form to a coworker and it was highlighted as a default even though I did not include any code to do that...

Now this morning, I opened the form again, the code is not there - as I was playing around looking at different options -  going back and forth from the work area to the pdf preview - all of a sudden the highlighting was off. The ONLY thing I did was turn on the line numbering for the XML source view. I checked other pdf forms including ones I did not create and now the fields are NOT highlighted.

Has anyone ever heard of any of this happening? Any idea of what's going on?

Avatar

Former Community Member

There is a setting in Acrobat/Reader that controls this setting by default (under Edit/Preferences/Forms). By adding it in script to the form you can override it.

paul

Avatar

Level 1

Is this why the script provided above is not working? Are you saying I need to add additional script regarding the setting in Acrobat/Reader that controls the default? I'm sorry I don't understand.

Avatar

Former Community Member

No I am saying that the bizarre behaviour you are seeing where sometimes it is on and sometimes off coudl be because of that local setting in Acrobat. By adding it to your form you are ensuring that no matter what the user chose for themself that you are setting it on.

Paul