Copy link to clipboard
Copied
Hi there, I was wondering if there is a way to enter a description into the boxes, that one needs to fill out later in a Form. With the same use as Quickinfo, but as Text in the field itsself. But if one clicks on it, the description disappears and one can just fill out the box. You could also call it example-Text... Any ideas? Thank you 🙂
You can use this code as "Custom Format Script"
if (!event.value) {
event.value = "text goes here";
event.target.display = display.noPrint;
} else {
event.target.display = display.visible;
}
It also won't print instruction text if you need to print file.
Without using a script the only option is the Tooltip text under the field's Properties. It will appear when you hover over the field with the mouse.
Select prepare form tool:
Then right click on your text field and select 'Format' tab:
Then click on the field where says 'None' and select 'Custom'
Click on 'Edit' and paste my code in there.
If you used that code it should disappear when you click in field.
For the first script, did you place it as a custom Format script, or something else?
If you use the code I provided in that thread the text will disappear when you click into the field.
In field properties under options tab check "Allow rich text formatting" and use this:
var spans = new Array();
spans[0] = new Object();
spans[0].text = "Did you validate work?"+"\n"+"Do you have supporting documents?"+"\n"+"Have you consulted others?";
spans[0].fontStyle = "italic";
spans[0].textColor = ["G",.8];
if (!event.value) {
event.richValue = spans;
event.target.display = display.noPrint;}
else
event.target.display = display.visible;
I added so text is also light gray, if you don't want that,
...Copy link to clipboard
Copied
You can use this code as "Custom Format Script"
if (!event.value) {
event.value = "text goes here";
event.target.display = display.noPrint;
} else {
event.target.display = display.visible;
}
It also won't print instruction text if you need to print file.
Copy link to clipboard
Copied
Hi Nesa
Thank you for your reply! Unfortunately i don't know how to use codes in Adobe.. and in general 🙂 Is there a way to do it without codes or can you tell me how to do it this way?
Thank you and kind Regards
Laura
Copy link to clipboard
Copied
Without using a script the only option is the Tooltip text under the field's Properties. It will appear when you hover over the field with the mouse.
Copy link to clipboard
Copied
Select prepare form tool:
Then right click on your text field and select 'Format' tab:
Then click on the field where says 'None' and select 'Custom'
Click on 'Edit' and paste my code in there.
Copy link to clipboard
Copied
Hi Nesa
Nevermind, i figured it out 😄 Now one further question: is there also a possibility to make the text disappear as soon as you click in the field and fill it out?
Copy link to clipboard
Copied
If you used that code it should disappear when you click in field.
Copy link to clipboard
Copied
Nesa, is there a way to break multiple lines if instructions inside of the "text goes here" portion?
I want the end result to simulate a sequence of steps.
Copy link to clipboard
Copied
You want to show all 3 questions at the same time , with each question be on different lines?
Set field to multiline and use this:
if (!event.value) {
event.value = "Did you validate work?"+"\n"+"Do you have supporting documents?"+"\n"+"Have you consulted others?";
event.target.display = display.noPrint;}
else
event.target.display = display.visible;
Copy link to clipboard
Copied
Thank you, that worked perfectly.
One last question.
How can I italicize those same three questions?
Copy link to clipboard
Copied
In field properties under options tab check "Allow rich text formatting" and use this:
var spans = new Array();
spans[0] = new Object();
spans[0].text = "Did you validate work?"+"\n"+"Do you have supporting documents?"+"\n"+"Have you consulted others?";
spans[0].fontStyle = "italic";
spans[0].textColor = ["G",.8];
if (!event.value) {
event.richValue = spans;
event.target.display = display.noPrint;}
else
event.target.display = display.visible;
I added so text is also light gray, if you don't want that, remove this line from script:
spans[0].textColor = ["G",.8];
Copy link to clipboard
Copied
EXCELLENT, Worked Perfectly. Thank you again.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi there, thanks a lot for all the replies! I figured out how to insert the code, but with both versions, the one from Nesa and the one from the website "try67" the text does not disappear, when i click in the field. One has to delete it first manually... any suggestions?
Copy link to clipboard
Copied
For the first script, did you place it as a custom Format script, or something else?
Copy link to clipboard
Copied
If you use the code I provided in that thread the text will disappear when you click into the field.
Copy link to clipboard
Copied
Ok thank you so much for all the help, figured it out now 🙂
2 further questions though:
1. is there a way to have the description-text in a different shape or colour than the one that is typed in in the end?
2. In case the text i need to fill in the boxes is too much for the given space, is there a way that the text then just gets smaller so it fits in the box in the end? Because now it just starts scrolling and then if you would want to print it, you wouldn't see the whole information...
Copy link to clipboard
Copied
You can use different aproach if you want to change text color and size.
Go to field properties -> action tab and add javascript for both onFocus and onBlur actions:
Just make sure where it says "Text goes here" when you change that text change it in both codes and make sure it's same in both codes.
Or if you know how to add default value to text field replace "Text goes here" with:
event.target.defaultValue
On Focus:
if(event.target.value == "Text goes here"){
event.target.value = "";
event.target.textColor = ["G",0];
event.target.textSize = 15;}
On Blur:
if(event.target.value==""){
event.target.value = "Text goes here";
event.target.textColor = ["G",.5];
event.target.textSize = 10;}
You can change colors and text size as you see fit.