Copy link to clipboard
Copied
Hello -
I am hoping someone might be able to tell me why the below does not work? Basically, I am trying to hide a button; using another button. From the research I have found, it seems the below should work...but it doesn't...nothing happens? 😞
Anyone have any ideas as to what may be preventing the below from working:
Button name: Attach
this.getField("Attach").display = display.hidden;
Thanks in advance for your time
Never mind...I found it...just removed the "this." and all is well
Final working result:
getField("Attach").display = display.hidden;
Thank you
Copy link to clipboard
Copied
Hello -
I am hoping someone might be able to tell me why the below does not work? Basically, I am trying to hide a button; using another button. From the research I have found, it seems the below should work...but it doesn't...nothing happens? 😞
Anyone have any ideas as to what may be preventing the below from working:
Button name: Attach
this.getField("Attach").display = display.hidden;
Thanks in advance for your time
Never mind...I found it...just removed the "this." and all is well
Final working result:
getField("Attach").display = display.hidden;
Thank you
Copy link to clipboard
Copied
Never mind...I found it...just removed the "this." and all is well
Final working result:
getField("Attach").display = display.hidden;
Thank you
Copy link to clipboard
Copied
That should not matter. From what context did you run this code?
Copy link to clipboard
Copied
Hi Try67 -
Yes, I would not have thought that would have mattered; but apparently with buttons it does. It works fine on text box fields with the "this." included; but not buttons for whatever reason? When I removed the "this." it worked on the button(s).
I was using this in the Action control, Mouse Up, Run Java Script
Copy link to clipboard
Copied
Works fine for me.
Copy link to clipboard
Copied
Well now that is interesting...ya, I only had the one line for testing purposes...for whatever reasons it was not working with buttons, for me; only text box fields. I am using Pro X...not sure if that makes a diff?
Copy link to clipboard
Copied
I tried it in XI Pro. Could be a bug in your specific version.
Copy link to clipboard
Copied
It is puzzling...thanks for your response and input Try67. Not sure why, but got it to work. Hopefully this will help anyone else out there that may have or is experiencing something similar.
Thanks again
Best regards
Copy link to clipboard
Copied
it sounds like something is happening to change the context of the event.
put this code in the same button script and let us know the result that shows in the console window:
console.println("test:" + this.toString()");
it should print
[object Doc]
if not, then something is off.
Copy link to clipboard
Copied
Hi Thom -
Well...hmmmm...I can't seem to get past this?
Copy link to clipboard
Copied
Drop the last set of double-quotes.