This topic is locked
[SOLVED]

 Access to a JavaScript Onload event variable from a botton Client Before

7/10/2018 10:26:47 PM
PHPRunner General questions
B
bakersalah author

I have a variable (e.g. var nVariable; ) in a List page -> JavaScript Onload event, is there any way to access this variable from Client Before or Client After of a cuatom button placed on the same List Page ?

F
fabiofurlan 7/11/2018

I'm also interested

B
bakersalah author 7/11/2018

Any Hints !!

By the way I use the latest v9.8 of PHPRunnerPro ed
Thanks in advance

admin 7/12/2018

Try global Javascript variable. In your Javascript OnLoad event use something like this:

window.myvar = "something";


Then you can use window.myvar anywhere on this page.

B
bakersalah author 7/13/2018

Sergey,

Thank you very much. Worked perfectly.

By the way I tried that before but my mistake.. I declared the variable in the Javascript onlaod like :

var myvar = "something";

then I tried to use the variable from within the custom button Client Before like :

var nX = window.myvar ;

so it did not work. I mentioned this so other members will not do the same mistake.
Thank you again. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=85391&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />