Hello all,
I have a problem with my page in that I have someone else's page sending me data in the query string. I need to grab the data from the string and pass it on as a hidden value.
I have a form on MY page that I just want to add this data to as "input type=hidden" which will all then be "post" to a CGI script that I have done in Perl.
Here's how I grabbed the data from the string, tell me if I did this right:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getArgs() {
var args = new Object();
var query = location.search.substring(1);
var pairs = query.split(",");
for(var i = 0; i < pairs.length; i++) {
var pos = pairs.index0f('=');
if (pos == -1) continue;
var argname = pairs.substring(0,pos);
var value = pairs.substring(pos+1);
args[argname] = unescape(value);
}
return args;
}
// End -->
</script>
And then I try to add it to MY page's form using:
<input type=hidden name="dataname" value=here's where I have the problem>
What do you suggest?
Thanks for whatever help you can give.
Tam