Hello,
I have a form where the user needs to be able to add an underline under specific words (from a list) and turn off the underline if it is no longer needed.
I have been able to do this by using two buttons:
'Object 1' contains the word
'Object 1 Underline' is a hidden, filled button below the word that has been collapsed so it just looks like a line.
'Object 1' is set to show 'Object 1 Underline' when clicked.
When you click 'Object 1 Underline' it hides itself.
This works, but it seems cumbersome, especially since there my be 50 or more words affected on each page and there might be 10-15 pages.
I wondered if there is a way to simply underline a word (as a text format feature) with some kind of toggle button.
I'm using Acrobat 9 on a Mac but do have access to LiveCycle Designer.
Thanks.
Here's a way to do it:
Make a set of child fields with a parent named 'underline'. The fields child names are up to you. If you want to number them, or use the word that they contain, or some other naming convention. (i.e.: underline.hello [b]or[/b] underline.1)
Then you make a button to toggle the underline. To turn on/off the highlights for all the fields, here is the javascript:
Now, let's say you wanted to only underline the word in a list. Well, in this case you have to specify the child name. So if you commit selected value immediately of the list, then you can use the event.value in a function to do each underline individually.
Let's say you have 3 fields underlining the words: 'Hello', 'Thanks', 'Bye' and therefore, are named: 'underline.Hello', 'underline.Thanks', 'underline.Bye' respectively.
The list has these as the item value: 'Hello', 'Thanks', 'Bye'
The list has a custom keystroke script set under the Format tab:
One thing you have to remember when it comes to names of fields: [b]Case dependency[/b]! If you have a field named 'underline.Hello', it is NOT the same as 'underline.hello' Keep that in mind when you make your list and the item/export value has to be the same otherwise it'll attempt to target another field.