Expand my Community achievements bar.

Setting FillColor to transparent

Avatar

Former Community Member
Hello all,



I am having a problem with a form I am laying out in LiveCycle Designer. I have a textfield that users click on and enter information. After the users are done updating the text field, if the text field contains a value I want it the fillcolor to be white. If the text field contains no value, I want it to be tranparent.



I already have the code to check to see if the text field is empty or if it has a value. My problem is in making the field transparent. In previous versions of Acrobat I used to use:



this.getField("FieldName").fillColor = color.white;



and



this.getField("FieldNme").fillColor = color.transparent;



this.getField no longer works with this new Acrobat. Instead, with LiveCycle Designer, for white, I am using:



this.fillColor = "255", "255", "255";



which works perfectly. I don't know how to set the transparency.



this.fillColor = color.transparent;



does absolutely nothing.



Does anyone know what I am doing wrong?



Thanks in advance,

Matt
14 Replies

Avatar

Former Community Member
What's your ultimate goal for doing this? Are you trying to make the field disapear if it has no value?



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Yes, that is exactly what I am trying to do.

Avatar

Former Community Member
this.presence = "invisible";



will do it for you then.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Yes, I tried that, and it does make the text field disappear.



But... there is no way to make it reappear. What I want to do is set the background to transparent if there is no value, unless the user goes back and enters a value, when I want the background to turn solid white.



You see, there is an image behind the text field. If the user has information entered, I want the background to be white so the image doesn't interfere with the text. But if the text field contains no value, I don't want an empty white rectangle, I want it to turn back to transparent to show the image behind it.



If I set this.presence to "invisible", the user can no longer interact with the text field, and they may want to do so before they print the form.



Does that make sense?

Avatar

Former Community Member
Ok, try this then. At Design time set your text field to have a white fill color. Then in script you can make it transparent by doing:



this.ui.oneOfChild.border.presence = "hidden";



The user can still click in and type in the text field even though it is transparent. To set it back to a white fill color later you would do:



this.ui.oneOfChild.border.presence = "visible";



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Chris, I do appreciate all the help you are giving me.



But it still isn't working. This is my code so far:



--- form1.#subform[0].txtComments::exit - (JavaScript, client) ---



var CheckText;



CheckTest = this.rawValue;



if (!CheckTest) {



this.ui.oneOfChild.border.presence = "hidden";



} else {



this.ui.oneOfChild.border.presence = "visible";



}

Avatar

Former Community Member
Ok, here's a quick sample. If you click in the text field and click out without typing anything it will turn transparent. If you click in it, type something, and click out it will be non-transparent.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Chris, first off thank you so much for your patience. I really appreciate it.



I opened your sample file and it works perfectly. But when I create something similar myself it simply doesn't work. I created a brand new file, inserted an image, and inserted a textbox on top of it. I gave the textbox a white fill, and I copied and pasted your code into the text field's Exit event. And it just doesn't work.



What's more, I tried copying and pasting your textbox and image into a file of mine, and yours didn't work in my file.



I have uploaded my sample. I don't know how to attach files to these messages, so you can find it at:



If you could just take a quick look at it and let me know what I am doing wrong that would be great. I'm sure it's something minor.



Oh, and for the record, I am using Adobe LiveCycle Designer Version 7, 0, 041126, 0 Cipher: 128-bit, in case that has something to do with it.



This is driving me up a wall. I thought this would take 2 minutes to do and I have literally spent hours trying to make it work.

Avatar

Former Community Member
No problem. Grabbed your form, the problem is the PDF was saved as a static PDF. For this sort of manipulation it needs to be dynamic. I've saved it as dynamic and attached it. It now works as desired.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
THANK YOU THANK YOU THANK YOU!!!



My form is working! All it needed was to be saved as dynamic. This is such a relief.



Thanks so much.

Avatar

Former Community Member
hello,



I got a problem which is similar to this one. I want the user to chose a picture in a field. The problem is that this picture should be in the background. When designing the form I sent the image field to the background but when testing the form, after having chosen a pic, it is in the front. So it's not as easy to chose the fields below as it usually should be.



Does anyone now how to solve this? Perhaps I should mention that I'm currently working with LiveCycle Designer 7.0. Is this "bug" fixed in 7.1?



Is it possible to update? The update manager doesn't search for any update of this program!

Avatar

Former Community Member
That is unrelated to Designer, it's related to the type of object in the PDF that is necessary to have a field which the user can click to select an image. That type of object will always be on top. You can have a background image by using an Image object in Designer instead of Image Field, but then the user can't select the image to use.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Thanks Chris.



Is it possible to write a script in order to have a small Image Field where the user can select an image and to have an Image object in the background where the chosen picture will be placed?



Does anyone know how to solve this?

I'd be very thankful because this is one of the last problem I'm having with a project..

Avatar

Level 1

Has anyone figured out how to actually make the background transparent?

I'm *not* trying to make the field disappear, but instead color it under certain conditions and remove that color (i.e., transparent) under others. I make frequent use of "under-field" labels and such for guidance on my forms (e.g., light grey numbers on the far margin to enumerate the order in which the fields are being filled out. And, yes, this was a design requirement from my customers, even with a rigorously test tab order, they wanted the controls numbered.)

Thank you!