I have a variable with a numberic value calculated/defined within a function. In some other part of the page, I want to be able to use the value of that variable; however, since that variable is generated as part of the previous function, it is defined as a local variable and its value is not available to the other function.
Is there a way to be able to transport the value of a local variable to a function that is out of scope? I welcome any suggestions.
As I described above, I would like to be able to use the value of the var_Local as part of the onsubmit, but I am getting a var_Local is unknown error, even though I can see/write its value if I do document.write within the some_Funciton() function
Thanks
Is there a way to be able to transport the value of a local variable to a function that is out of scope? I welcome any suggestions.
Code:
<script type="text/javascript"> function some_Function() { somecode....; var_Local = some_Value; } </script> <script type="text/javascript"> function some_Other_Function() { somecode....; } </script> <form action="http://www.mydomain.com/results.php" method="post" name="form" onsubmit="return (some_Other_Function(var_Local))"> </form>
Thanks
Comment