Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Required fields in red

Avatar

Former Community Member
Since the upgrade to Acrobat Reader version 9, we've found that the caption gets highlighted with a red border when this required field is empty and not filled in. In earlier versions, only the input box area was highlighted in red. Is this intentional?
37 Replies

Avatar

Former Community Member
Hi,

I tested with Acrobat 9 Professional, and the required filed is highlighted when the function highlight fields is activated in Acrobat. When I turn off this feature, the field is not hghlighted. The caption is never highlighted with or without the highlight feature activated. Maybe this is a bug with Reader 9?

Avatar

Former Community Member
Thanks for checking Daniel. Did you also try it in Reader by any chance? Also, my caption is above the field, but I didn't get to test if it matters where the caption is located.

Avatar

Former Community Member
Because of issues when running Acrobat Pro and Reader on the same machine, I only tested with Acrobat Pro. Where the caption is placed shouldn't matter. By the way, what happens if you open the pdf in Acrobat instead of Reader?

Avatar

Former Community Member
I am also needing to change the ugly red borders. My employers are really disappointed at the way Reader 9 displays mandatory/required fields. They simply do not like the look and feel. In LiveCycle 8.2, the program uses two red borders, one around the entire field (caption & entry) and one around the entry area.



Now we need certain fields on the form to be required, but we don't want these ugly borders. How can I change them? Or maybe Adobe needs to change the way they present a required field? The way it is now, simply will not do...and they are considering making me change this form again (which already took me weeks as complicated as it is with all the scripting)...doesn't seem quite fair to the developer if we can change many things, why can't we change this too?



TEMPORARILY, when a user exits a required field and it has a value, the mandatory setting is disabled, removing some of the red. But when the user initially loads the form, it's plastered in RED. I want the field to be required, but looking like this pushes away our customers costing our company business.

Avatar

Former Community Member
The red border should not show up until a submit is hit. When I load a form that has required fields, there is no red border until I hit submit then the border appears. You are indictaing that the red border appears when the form is initially loaded....is this true?



There is a setting in the Acrobat preferences that allows you to change the color but the border will still appear. Look under the Forms category if you want to change it.

Avatar

Former Community Member
The red border should not show up until a submit is hit. When I load a form that has required fields, there is no red border until I hit submit then the border appears. You are indictaing that the red border appears when the form is initially loaded....is this true? There is a setting in the Acrobat preferences that allows you to change the color but the border will still appear. Look under the Forms category if you want to change it.

Avatar

Former Community Member
Yes, the red borders show when the form is INITIALLY viewed. I've had many people come and complain to me that they do not like the red borders. I told them that I wrote some code to remove the red border once the field was filled out, but that wasn't good enough. We do not want the red borders to show when the form is initially loaded.



Here's a snapshot image showing a required field when it's initially loaded:



Avatar

Former Community Member
Thanks Heather, for the the image. That's exactly the ugly red border I get. I can't understand why version 9 would color both the caption and input field red. Even when the caption is to the left of the input field, it looks bad. Hopefully Adobe will remove the red border from the caption.

Avatar

Level 4
if (app.runtimeHighlight == true)

{

app.runtimeHighlight = false;

}



I have this in my root form initialisation. Just turns off highlighting, including shading the fields with the blue fill.



Regards,



Tom

Avatar

Former Community Member
My hopes as well, Scott.



Thanks for your reply Tom. That certainly does get rid of the ugly red borders. Unfortunately, I still need the fill shading (light blue, or whichever system color they have set) of the fields.

Avatar

Level 4
Ah, I got lucky. My boss wanted it all turned off.



I remember seeing something to do with changing the border colours to invisible, but can't remember exactly what.



Sorry I can't be of more use,



Tom

Avatar

Former Community Member
Here is some code from a JavaScript object in one of my forms. textEdit should probably be changed to oneOfChild.



function VerifyField(field) {

if (field.rawValue == null) {

scoSpecific.IndicateError(field.ui.textEdit);

} else {

scoSpecific.ClearHighlight(field.ui.textEdit);

}

}

function IndicateError(field){

ChangeBorder(field, "255, 0, 0", ".175mm");

}



function IndicateRequired(field){

ChangeBorder(field, "0, 0, 255", ".175mm");

}



function ClearHighlight(field){

ChangeBorder(field, "0, 0, 0", ".175mm");

}



function ChangeBorder(field, color, thickness){

field.border.getElement("edge", 0).color.value = color;

field.border.getElement("edge", 1).color.value = color;

field.border.getElement("edge", 2).color.value = color;

field.border.getElement("edge", 3).color.value = color;



field.border.getElement("edge", 0).thickness = thickness;

field.border.getElement("edge", 1).thickness = thickness;

field.border.getElement("edge", 2).thickness = thickness;

field.border.getElement("edge", 3).thickness = thickness;



field.border.getElement("corner", 0).color.value = color;

field.border.getElement("corner", 1).color.value = color;

field.border.getElement("corner", 2).color.value = color;

field.border.getElement("corner", 3).color.value = color;



field.border.getElement("corner", 0).thickness = thickness;

field.border.getElement("corner", 1).thickness = thickness;

field.border.getElement("corner", 2).thickness = thickness;

field.border.getElement("corner", 3).thickness = thickness;

}

Avatar

Former Community Member
I'm sorry for my ignorance, but how does this work in LiveCycle?

Avatar

Former Community Member
In the Hierarchy tab, right click on variable. Click "Insert Script Object". Name it myScriptObject. In a text field exit event put:



myScriptObject.VerifyField(this)

Avatar

Former Community Member
[Ctrl]+J brings up the JavaScript window when viewing the form. What are the errors?

Avatar

Former Community Member
Is your Script type set to JavaScript for the exit event and not FormCalc?

Avatar

Former Community Member
scoSpecific is not defined

3:1



Yes, I have the Script Type set to JavaScript.

Avatar

Former Community Member
rename your script object to scoSpecific and the line in the exit event to scoSpecific...

Avatar

Former Community Member
Ok, so I do that and still nothing happens, and there aren't any errors this time either...