Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Textfield turns black when script runs

Avatar

Level 9

I have javaScript that runs when a textfield changes. Part of the script makes custom buttons invisible if they are currently visible.  When running the script, the textfield involved value turns black. Can anyone tell me what would make a textfield turn black when a script like the one below runs? If you click outside of the field, the black disappears.

MEG02.QAN.FirstActionReqSubform.ActionWrittenBy::change - (JavaScript, client)

this.resolveNode("QANemailSubform").presence = "hidden";

this.resolveNode("AddToRouterButtonSubform").presence = "visible";

if (this.resolveNode("MainSubform.Subform11.MEAdminSubmitButtonJB").presence = "visible"){

  this.resolveNode("MainSubform.Subform11.MEAdminSubmitButtonJB").presence = "invisible";

  }

if (this.resolveNode("MainSubform.Subform11.MEAdminSubmitButtonMH").presence = "visible"){

  this.resolveNode("MainSubform.Subform11.MEAdminSubmitButtonMH").presence = "invisible";

  }

if (this.resolveNode("MainSubform.Subform11.MEAdminSubmitButtonMM").presence = "visible"){

  this.resolveNode("MainSubform.Subform11.MEAdminSubmitButtonMM").presence = "invisible";

  }

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi

I don't why the field would be turning black, but wonder if this code could be moved to another event, maybe the exit event as the change event will be fired for every character.  Maybe the form is so busy running this code that it doesn't have time to repaint the field properly?

It you can publish your form somewhere, I would be interested in seeing this happen.

Regards

Bruce

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi

I don't why the field would be turning black, but wonder if this code could be moved to another event, maybe the exit event as the change event will be fired for every character.  Maybe the form is so busy running this code that it doesn't have time to repaint the field properly?

It you can publish your form somewhere, I would be interested in seeing this happen.

Regards

Bruce

Avatar

Level 9

Changing to the "exit" event solved the problem. Sorry, I am un able to publish this form. Apparently having the code in the change event and it firing with every new character, was causing this issue. I have never seen it before and I have created hundreds of LiveCycle forms.

Thanks for your reply and feedback!

-Don