These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Forms

MKremzier
Registered: Nov 6 2008
Posts: 14

I am creating an order form and want to have an address in black font color and if a change is made to the address the color changes to red is this something that is possible to do in the adobe acrobat forms?

My Product Information:
Acrobat Pro 8.0, Windows
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
Yes, you can do that with a custom validate script, but you should set up the address that you want in black to be the default value of the field. The custom validate script could then be something like:

if (event.value === event.target.defaultValue) {event.target.textColor = color.black;} else {event.target.textColor = color.red;}

which could be simplified to:

event.target.textColor = (event.value === event.target.defaultValue) ? color.black : color.red;
If you don't want to set a default value, post again, as there are other approaches you can take.

George
MKremzier
Registered: Nov 6 2008
Posts: 14
Where do I put the code or custom validation? Is there an easier way? The other question when you add the send email button it returns only data can it email the form?
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
In the field properties dialog, see the Validate tab > Run custom validation script. It really is quite easy, just a single line of code.You can set up a submit action that causes the entire PDF to be transmitted. Do you need it to work with Reader? This has been covered here many times, so you should find more information with a search. But if you get stuck, post again.

George
MKremzier
Registered: Nov 6 2008
Posts: 14
I have tried copying and pasting both (at separate time) code in the validation script message and also the validation pattern message box and then save the form. I open it type in my name and save and close then re-open and change the name and the new name is still in black. I must be doing something wrong.

Marsha
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
You probably did not set the default value of the field to the address that you want. You do this via the Options tab of the Field Properties dialog (Default Value). Place the script as the custom validation script.

George
lbkj
Registered: Nov 11 2008
Posts: 8
How do you create an expandable text field
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
lbkj wrote:
How do you create an expandable text field
You might want to start a new topic for this question. It would help if you supplied more information about your needs.

George
MKremzier
Registered: Nov 6 2008
Posts: 14
I am missing something. I am not able to find the Options tab of the Field Properties dialog (Default Value). Is it on one of the palettes?
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
It's on the Options tab. The other tabs are General, Appearance, Actions, Format, Validate, and Calculate.

If you are asking about getting the Field Properties dialog to appear, you can select the "Select Object Tool" or the "Text Field Tool" and double-click on the field. This should cause the dialog to appear and you can select the Options tab.

George
MKremzier
Registered: Nov 6 2008
Posts: 14
Thanks for all of the help with the forms. I finally have the validation in the right place but I want to type the name, address and phone number in a black font color and change to red if the client/customer re- types the name, address and phone number. When I tested it I can only get the name, address and phone number to be red font color.
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
What did you set the default value of the field to?
MKremzier
Registered: Nov 6 2008
Posts: 14
Is the default value in the options tab and if so how do I tell it black. If it is the appearance tab then black is the selected font color.
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
You set the default field value using the corresponding entry on the Options tab.

The validation script is what controls the color of the text. When the field value is the same as the default value, the text color will be black. Otherwise, the text color will be red.

George
MKremzier
Registered: Nov 6 2008
Posts: 14
I am really sorry that I am not getting this it is the first time I have worked with validation scripts and I am confused about where to put which scripts that I am coping and pasting from above posting 2008-11-06.
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
Download this sample: https://share.acrobat.com/adc/document.do?docid=cf4c2a94-7a6a-4e9d-88df-49acc0b3d6c8

It contains a single text field that is set up to behave as you want. I set the field's default value to "Acrobat" using the Options tab. The script is a custom validation script that you can access using the Validate tab.

George
MKremzier
Registered: Nov 6 2008
Posts: 14
I got it. I actually had it all along and did not know it. Thank you soooo much. I have created my button to email the form back to me but I get a message that the document is trying to connect to: ///C|/Documents%20and%20settings and on and on. Under the button properties action tab I have selected an action of submit a form and entered the email address that I want it to come back to. Do I need to do something different so that I do not get the ///C|/Documents%20and%20settings if front of my email address?