Setting FillColor to transparent | Community
Skip to main content
July 31, 2006

Setting FillColor to transparent

  • July 31, 2006
  • 14 replies
  • 8352 views
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
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

14 replies

July 31, 2006
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
July 31, 2006
Yes, that is exactly what I am trying to do.
July 31, 2006
this.presence = "invisible";



will do it for you then.



Chris

Adobe Enterprise Developer Support
July 31, 2006
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?
July 31, 2006
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
August 1, 2006
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";



}
August 1, 2006
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
August 1, 2006
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.
August 1, 2006
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
August 1, 2006
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.