Hello everyone, I'm trying to create my first digital form but i've got a little problem....
I'd like to create a button that add a specific text to the field (at the end of the current phrase) without loosing the rest of the text.
I wrote "abc" in field X --> "click button 1"---> "abc defg" ---> "click button 2"---> "abc defg hijk" etc....
Every button add a little piece of text...Is it possibile?
Sorry for my bad english =)
Yes, it's possible. It's not clear how you will determine what text you want to add though. Here's a small script that will add " defg" to whatever text is in a field:
// Mouse Up script for a button
// Get the field object
var f1 = getField("Text1");
// Set the new value
f1.value = f1.valueAsString + " degf";
Thanks a lot! Your script worked very well but unfortunatly it causes the loss of the richtext information of the field.
This is the work around I used to obtain the correct Line Space that i needed: http://forums.adobe.com/message/5484128#5484128
Screenshot (before and after using your script): http://img843.imageshack.us/img843/1795/xwky.jpg