please forgive me if this is stupid question as my knowledge of programming is limited and thanks in advance for the answers.
i have an external javascript file test.js and it has
test.js
-------------------------
Expand|Select|Wrap|Line Numbers
- var x = null;
- var y = null;
- function goSubmit()
- {
- x = document.getElementById("machine").value;
- alert(x+"inside");
- }
- function calling()
- {
- y = x;
- alert(y+"outside");
- ....somecode
- }
[HTML]<html>
<head>
<script language="javas cript" src="test.js"></script>
</head>
<body>
<i><input type="text" onclick="this.v alue = ''" id="machine" value="Enter Node Name!" size="36" name="machine"> </i>
<a onclick="javasc ript:goSubmit() " href="other.htm l" target="_self"> Connect</a>
</body>
</html>[/HTML]
and the result i get when i input the name "system1" i got the following reults
system1 inside
null outside.
so the question is there any work around possible to assign value to global variable so that they can be used later on in the script. some coding example (if possible making the above script complete) will be highly appreciated.