Skip to main content
Inspiring
Sep 8, 2020 5:20 PM UTC
Answered

focus/blur

On buton field I use focus/blur to show/hide text field1, on my field2 I set up code if field1 is visible ,field2 show some text, but "on focus" doesn't count field1 as visible. Is there way to fix that?

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Sep 8, 2020 8:10 PM UTC

I do use mouse enter/exit you can see it in button field action tab.


But you're not using a script... Use this code:

 

// Mouse Enter

this.getField("Text2").display = display.visible;
this.getField("Text3").value = "Text";

 

// Mouse Exit

this.getField("Text2").display = display.hidden;
this.getField("Text3").value = "";

11 replies

ls_rbls
Community Expert
Community Expert
Sep 8, 2020 6:03 PM UTC

Share your script, where are you running it from?

Translate
Technical Generalist
blazbAuthor
Inspiring
Sep 8, 2020 6:28 PM UTC

Hi, just to correct mistake, it's not on focus/blur it's on Mouse enter/exit.

I use code in field2 as custom calculation script, it works if I change code to hidden but it doesn't work for visible.

var a = this.getField("Text2");
if (a.display = display.visible){
event.value = "text";}
else event.value = "";

Translate
try67
Community Expert
Community Expert
Sep 8, 2020 7:08 PM UTC

Change:

if (a.display = display.visible){

To:

if (a.display == display.visible){

Translate