Dear all,
I get stuck in the middle and would like to get some help:
I got the first page, and have a javascript function (a.html)
<html>
<head>
<script type=”text/javascript” src=”js/a.js”></script>
</head>
<body>
<INPUT id=depaddress name=depaddress type=”textbox” class=”txtinput” size=30>
<input type=”submit” value=”Submit” onclick=”submitroute()”>
</body>
</html>
The code in a.js is as follows. I want to pass the value in depaddress to another html file (I don’t want to generate the html code on the drive as I have quite a lot of code and information in that html file):
function submitroute() {
var depaddress = document.getElementById(‘depaddress’).value;
var div = “apple”;
var url = “b.html”;
var myAjax = new Ajax.Updater(div, url, {method: ‘get’, evalScripts: true, parameters: ‘depaddress’});
}
b.html
<html>
<head>
<script type=”text/javascript”>
alert(depaddress);
</script>
</head>
<body>
<div id=”apple”>
</div>
</body>
</html>
I cannot get the value of depaddress in b.html. How can I pass the variable in the a.js to b.html? I don’t want to get involved the server-side programming language like php as I want to keep this in the client side.
Thanks heaps!
Kelvin