Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

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
Thank you S. Bishop for all your help, but I cannot get your method to work, nor am I exactly sure what I'm supposed to see...



Now my employer wants me to not make these fields required anymore because "it isn't appealing to the eye and thus doesn't meet the professional image we want to convey to our agents". Meaning, the hours and hours I spent on coding to make the fields required and not required based on values, etc. is all for none because of this new way Adobe displays required fields.

Avatar

Former Community Member
Below was the answer to the original problem although I would just do:

app.runtimeHighlight = false;



------------

Thomas McConnachie - 12:26am Dec 19, 08 PST (#9 of 21)



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

---------------



My code was as an example to do your own border highlighting. Looking back now, I don't see it, but thought someone had asked how to change them manually. You could use similar code to change the back ground color. I am now thinking it may not do anything because it makes the borders red and they are already red for you.



This will set the background color of just the data area of a test field or most other data fields for that matter. It sets it to gray. The 200,200,200 are RGB values.

this.ui.oneOfChild.border.fill.color.value = "200,200,200";

Avatar

Former Community Member
Heather,



You probably have already thought of this, but as a temporary workaround that I did was to separate the caption from the input field (that is, make it two fields instead of one). Then it looks a little better unless you specified a margin in the Layout tab, then you'll see two red boxes around the input field!!



Scott

Avatar

Former Community Member
S. Bishop,



I figured out why I couldn't get the code

>this.ui.oneOfChild.border.fill.color.value = "200,200,200";



to work before and it's because I have my field's Appearance set to None so I don't have any borders around the entry area. If I choose Custom and set the borders to none, then I can use your script to change the fillable area. I might need this to work around my problem. Thank you!



Scott,



Actually, I didn't think of that. I will propose this as an option and see what they think. Although, it will take me a while since I will need to reconstruct my form. You see, it's a dynamic form with multiple flowing subforms that has about 80-120 fields on each page and it's 4 pages long. But if it will make my employer happy, I'm willing to tackle this beast. Thank you for your help.



Heather

Avatar

Former Community Member
Ok so now they figured they'd keep the required fields, but they want the highlighting turned off...and only come back on when the form is submitted. But how do I restrict the user from turning it back on themselves? Can I remove the Highlight Fields button? I tried setting the app.runtimeHighlight = false on the Layout:ready event so everytime the user clicked the button the highlighting would go back to false, but I guess clicking the Highlight Fields button doesn't trigger an event?

Avatar

Level 4
Its not changing the form itself, only the application, so I don't think it would.

Avatar

Former Community Member
Yeah, but that's where you're splittin' hairs...because it's changing the form visually, and to me, that would be/should be an event.

Avatar

Former Community Member
Hi. I tried to reproduce this problem and I don't see the captions being hilighted. Could someone please post an example form someplace (maybe share.adobe.com) so I can look into the problem.

Avatar

Former Community Member
There's an image above in message #7. Click the link, "View All Messages" if you don't see it.

Avatar

Former Community Member
Les,



It's easy to duplicate.



1) Create a new form in either livecycle 8 or 9.

2) Place a text field on the form. Type in text in it's caption

3) Set the Type to 'user Entered -required' in the value tab.

4) Place a submit button on the form



Now open the PDF in Acrobat or reader version 9 and then submit the form. You'll see the text field turn red along with it's caption.

Viewing the PDF in reader 8 doens't do this, only 9.



thanks for checking into this for us.

Avatar

Level 1

I'm getting the red border to show up when the form loads for a User Entered - Recommended textbox .  Seems the Validate event is firing when the form initializes.  There is no data connection, so the textbox is not being assigned a value.  Anyone know how to stop this?

Avatar

Level 10

Your file type (static/dynamic) could also influence this behavior..

Pls see the attached document (see page #8) which explains about the rendering static/dynamic pdfs...

I am not sure this will resolve your problem.

Nith

Avatar

Level 4

> Your file type (static/dynamic) could also influence this behavior..

> Pls see the attached document (see page #8) which explains about the rendering static/dynamic pdfs...

I already read that documantation before, though I don't think this is the problem. (But you're right... it looks quite much of a change to dynamic with a scripted border)

Something not listed in there is, that in static forms you have to extra write something if you make a field required by choice to get a read border.

In dynamic forms it appears automatically. But it only surrounds the input box. (Though normally the "border" you script means the border of the entire field in dynamic.)

Exception are the radiobuttons.

Avatar

Level 1

The form is dynamic.  I was looking to not have the red "required" border show up until the user hit the Submit button.  I don't want to write javascript for every required field.  The red border is showing up on initial rendering of the form.

Avatar

Level 1

I forgot to say Thank You for the responses so far.  I have learned a lot from them.  I appreciate it.

Avatar

Level 4

Haven't read everything... but writing a individual validation script for every field can get quite a bit of work.

(I know what kind of pain this can get, since I added a script in one of my forms that automatically prints and sends via mail when the user has filled out all mandatory fields. If not it first brings up the e-mail error message then jumps to the next mandatory field ... it was good for experimenting though...)

Why don't you just make it the other way round. make the field via script only then mandatory if it is no value entered. (Probably on a pre-submit event or something like that.)

If you refer to the field with "this", you can use the same script for every field... just copy and paste.

if (this.rawValue == null || this.rawValue == "")
{
this.validate.nullTest = "error";
this.assist.toolTip.value = "This field is mandatory, please provide a response...";
xfa.layout.relayout();
}

You could also tiptoe around the validation itself with some similar script.

I'd make one invisible field that gets true or false values from the mandatory fields. If a mandatory field is left blank and the field changes to false all mandatory fields will be bordered. (Alternativly: all mandatory fields not filled out are bordered.)

Avatar

Level 4

Hi

What a long thread!  I didnt get chance to read it all but I think that your problem can be resolved as follows:

When you click the submit email button and you have required fields ,an option in Acrobat tells it to highlight it in red.  Therefore if you wish to keep the required fields on you will need to set Acrobat to display the highlighted border to be the same colour as your text box.  You can do this in Acrobat by going to Edit > Preferences > Forms and changing the colour of the required fields colour to one that is the same as your text box.  I could not see a way to disable this.

Alternatively remove the required fields and add some validation into a normal button first to determine if the text field is valid or not.  If it is you can get the form to display your email button then.

I hope this helps

Darren