Copy link to clipboard
Copied
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?
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 = "";
Copy link to clipboard
Copied
Share your script, where are you running it from?
Copy link to clipboard
Copied
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 = "";
Copy link to clipboard
Copied
Change:
if (a.display = display.visible){
To:
if (a.display == display.visible){
Copy link to clipboard
Copied
Sorry that was just typo.
Here is my file if you want to look at it. https://drive.google.com/uc?export=download&id=1IqQzEPVskAQl68ZmN4JcJ34wcPGKyXo3
Copy link to clipboard
Copied
There's no code in this file, and the show/hide functions seem to work just fine.
Copy link to clipboard
Copied
Code is in Text3 field, custom calculation script.
Copy link to clipboard
Copied
Ah, I see... The issue is that entering and existing a field is not an event that triggers calculations, so the code never runs. You should do it in the Mouse Enter/Exit events of the button field, instead.
Copy link to clipboard
Copied
I do use mouse enter/exit you can see it in button field action tab.
Copy link to clipboard
Copied
I tried that suggestions too and I 'm not able to work around it either
Copy link to clipboard
Copied
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 = "";
Copy link to clipboard
Copied
Thank you so much.