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

How do you remove or change red border in Livecycle required field?

liztapanes
Registered: Jun 13 2007
Posts: 40

How do you remove or change red border in Livecycle required field?

When I make a field required, it makes the pdf show a thick ugly red border. How can I change that?

dbrooks
Registered: Sep 6 2007
Posts: 33
I think the red borders only come on if one or more of the required fields isn't completed or completed correctly. I have designed a form where I need all of the digits of an account number completed and some people don't key in the correct amount of digits. In this case, the red borders will show up around all of the fields that I've made required and the user isn't allowed to submit the form by e-mail until the field is filled in correctly. I believe it just emphasizes the fields that are required. If you click on the "highlight fields" button to turn it off, you shouldn't see them when the form is blank
Tech264
Registered: Apr 4 2008
Posts: 111
I know this is an old message posted but has someone ever solved this because that thick rick border is really bad on the eyes?
web_wolf
Registered: Jan 24 2008
Posts: 39
Yes, upgrade to 9.0. Those with Reader 7 or 9 will be ok.

Website Designer - Lititz, PA

Tech264
Registered: Apr 4 2008
Posts: 111
I did see the difference with version 9 but is there anyway to change the thickness of the border to a more thinner type?
web_wolf
Registered: Jan 24 2008
Posts: 39
Not on a required field no...

Website Designer - Lititz, PA

Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi web_wolf,

Are you also HDana?

Dimitri
web_wolf
Registered: Jan 24 2008
Posts: 39
Hi Dimitri,

Yes I am. When I had to change my profile, my name also changed.

Website Designer - Lititz, PA

Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Thanks web_wolf,

I was just curious because I recoginzed your pic. Too bad they couldn't add your post numbers to your new profile- sure appreciate the help you are providing :)

Dimitri
web_wolf
Registered: Jan 24 2008
Posts: 39
It's no problem, Dimitri. I know this stuff is pretty confusing. If I'm cruising through this website, I try to help when I can.

I'm not sure what happened when I had to create my new profile. Even when I click on the link to my profile it takes me somewhere else. But that's not that big of a deal to me. =)

Website Designer - Lititz, PA

PetafromOz
Registered: Jun 8 2009
Posts: 230
Liztapanes, I don't like the red highlighting either - although for a different reason. I don't like that it's not selective - it just highlights every 'required' field even if only one has been missed.

The only way I have been able to get around this is to provide a script in the Exit event of each field you want to set up as being 'required'. This means you can't use the Object>Value>User Entered - Required facility in the Object palette. You need scripts to perform that function. And it would mean you'd need to apply such scripts to any field you want to be mandatory - then you'll be able to set it to any sort of highlight (or none) that you want. You can also set the script to display a message or instruction to the user on what they should or shouldn't be entering into any given field.Alternatively if you have a Submit button or whatever, you could apply a single script to the Submit that would check any fields you deem mandatory, and highlight any that have been left blank (or whatever the rule is) - but you'd have to ensure the script addressed each of those required fields.

Here's an example of something I put together for a particular field:

----- form1.TextField1::exit: - (JavaScript, client) -----------------------------------------

if(this.rawValue == null) //if field left blank
{
this.border.fill.color.value = "230,230,255"; //highlight this field in a light blue colour
xfa.host.messageBox("You must enter details in this field"); //Warning message to tell them to enter something into the field
xfa.host.setFocus(Form1.TextField1); //set the focus back to the relevant field for completion
}
else
{
this.border.fill.color.value = "255,255,255"; //if info entered, set colour back to white
xfa.host.setFocus(SubmitButton); //if data entered, set the focus to the next field - or this case, button
}


I'm still a relative newbie at this stuff, but I'm learning fast. Still, there's probably someone out there who can offer something better, but this works for me.

Hope it helps, Peta

from way... underground at Parkes - central West NSW - Australia

web_wolf
Registered: Jan 24 2008
Posts: 39
PetafromOz,

I created a similar script for each field. My employers did not like all the red highlighting, so I made it disappear as fast as I could. I created a script object with a function that checks the field for a value and if it finds a value it disables the required field, but if it's null, it keeps the field required. Having the script object lets me use the same script multiple times and I can call it on any event for any field.
function expReq(f){f.mandatory = "error";if (f.isNull == false){f.mandatory = "disabled";}}

To check the field, I call the function on the exit event of the field with "script" being the name of my script object:script.expReq(this);
This way, if a user left a required field empty, it's easier to pick out...

Website Designer - Lititz, PA

PetafromOz
Registered: Jun 8 2009
Posts: 230
Wow, now that looks a lot tidier. Thanks web_wolf, I'll give this a go.

from way... underground at Parkes - central West NSW - Australia

br27ke
Registered: Nov 12 2009
Posts: 21
I like how the code above works for removing the red borders as soon as the field is filled in, but is there anyway to make the script check multiple fields at one time using a submit button?
web_wolf
Registered: Jan 24 2008
Posts: 39
br27ke,

You definitely can do that. What you could do is create a function that checks all those fields and then call that function on the submit button.

Website Designer - Lititz, PA

br27ke
Registered: Nov 12 2009
Posts: 21
Thanks for the quick response...I'm new to Livecycle and Java. Could you get me started on how to write the new function?
web_wolf
Registered: Jan 24 2008
Posts: 39
I don't know much about Java...but LiveCycle is written with some JavaScript...two totally different script languages...

To get you started, what you want to do is right-click on the highest level object in your hierarchy, which is the subform that wraps your entire form (Master Pages & everything), and select Insert Script Object. Then you want to name the script object; I usually name mine script. Then, within the script object is where you write your functions. One might look like:
function validateFields(){//javaScript goes here to check the fields}

validateFields is the name of the function and the word function must be in front of it to tell the script object that it's a function.

Call the function on the preSubmit event of the form, remember to specify the name of the script object and the name of the function.
form.Page1.submit::preSubmit:form - (JavaScript, client) script.validateFields();

Website Designer - Lititz, PA