Hello again!
I got my DropDown menu to change its color depending on the selected option ( http://forums.adobe.com/message/5156932#5156932 ) i thought that in a similar way I could make a TextField change its "background color" (actually i´m showing/hidden a red rectangle) depending on its content but is not.
If the TextField is empty we should see the background, as soon as the user enters content the background should be gone.
I have tthis code on the change event of the textbox:
if (xfa.event.newText != ""){
RectangleRed.presence = "visible";
}else{
RectangleRed.presence = "hidden";
}
But nothing happens, the red rectangle is always visible...
Any ideas?!
Thanks!
Views
Replies
Total Likes
Y change the code to this:
if (xfa.event.newText == ""){
RectangleRed.presence = "visible";
}else{
RectangleRed.presence = "hidden";
}
and now is working but the rectangle dissapears when you get out of the textfield, I´d like it to be gone when you start typing something, is that possible?
Views
Replies
Total Likes
Hi,
this should be possible this way:
RectangleRed.presence = xfa.event.fullText.length > 0 ? "invisible" : "visible";
Views
Replies
Total Likes
Hi,
is the same as before, the red rectangle disappears when you get out of the text field, not while writig on it..
Views
Replies
Total Likes
No, but I discovered a the reason why it looks like this.
Try to position the rectangle next to the text field. – You'll see it disappears immediately.
But if it is positioned behind the text field, the area for the text input is not updated immediatly, so it looks like the script doesn't work.
I don't see how to overcome this problem.
Views
Replies
Total Likes
You are right! Neither I don´t know why this happens.
Views
Replies
Total Likes