Click to See Complete Forum and Search --> : moving information from java to html


Danny
01-18-2003, 05:12 PM
What is the best way to move var datainfo = data[1];
to input into the html code so that I can pick it up using cgi scripts?

I'm getting data from the url that the user linked to the site with, spliting the url to get the users id number. I then need to get the id into html.

Thanks:( :confused:

pyro
01-18-2003, 05:18 PM
I would use a hidden input field. This should move your info into it...

document.formname.inputname.value = datainfo;

pyro
01-18-2003, 05:34 PM
To expound...

<html>
<head>
<script type="text/javascript">
var location = document.location.href;
var sublocation = location.split("?");
var newsublocation = sublocation[1].split("=");
var finallocation = newsublocation[1];
</script>
</head>
<body>
<form name="useridform">
<input type=hidden name="userid">
</form>
<script type="text/javascript">
document.useridform.userid.value = finallocation;
</script>
</body>
</html>This includes the code that I wrote earlier for you, so it should be the complete solution.