Hi,
I have a situation where I have a textarea in a form. This form is passing the textarea to a new page (actually I needed it to be shown in a entirely new window so I have a bit of javascript that loads a new window and passes the textarea value in the URL)
So when the javascript encounters the textarea with values
a
b
c
it produces "newwindow.php?value1=abc"
and shows on page 2 as "abc"
I need to output the data entered into the textarea on page 1 on page 2, exactly as it has been typed.
It is essential that I get the form value shown on a new window, if it were to direct to the same window there is no problem as it doesn't have to be passed through the URL.
Below is my code, including the javascript.
If anyone can help, then I'd be most grateful,
Regards,
Adrian.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function SubmitUnits(totalvalues, formname, winwidth, winheight)
{
var valueslist = "";
var FullSearchUrl2 = "";
for(i = 1; i <= totalvalues; i++)
{
if (i > 1) { valueslist = valueslist + "&";}
valueslist = valueslist + "value" + i + "=" + eval("exercise.value" + i + ".value");
}
var FullSearchUrl2 = "newwindow.php?" + valueslist;
var WindowName = "newwindow" + formname;
newWindow=window.open(FullSearchUrl2,WindowName,"resizable=yes,location=no,width=" + winwidth + ",height="+ winheight + ",locationbar=no,directories=no,header=no,title=no,scrollbars=yes");
}
</script>
</head>
<body>
<form name="exercise" method="post" action="" target="_new">
<table width="100%" border="0">
<tr>
<td align="center">
<textarea name="value1" cols="60" rows="10"></textarea>
</td>
</tr>
</table>
<p align="center"><b><a href="javascript:SubmitUnits(1,'5_1B',560,550);">Submit
your answers >></a></b></p>
</form>
</body>
</html>