View Full Version : help.
gigisakura
07-27-2005, 04:07 PM
How do I send like one form entry to a text area in a new page??? does it need java script??? or is there a code???
This was discussed a while ago. A referral was made to a script designed to parse GET variables from URIs, but I can't seem to find it again; perhaps John or Mike knows where it is?
jscheuer1
07-27-2005, 06:30 PM
If you Google:
"site:http://www.dynamicdrive.com/forums/archive/ var1 jscheuer1"
without the quotes, you will find tons of examples. A basic approach could be, to have on the sending page:
<input id="sendInfo" type="text" value="default"><br>
<a href="somepage.htm" onclick="location.href=this.href+'?var1='+escape(document.getElementById('sendInfo').value);return false;">Link</a>and your receiving page could look like this:
<html>
<head>
<title>Somepage</title>
<script type="text/javascript">
function populate() {
var str = unescape(location.href);
thePos = str.indexOf("=") + 1;
document.getElementById('recInfo').value=str.substr(thePos);
}
window.onload=populate;
</script>
</head>
<body>
<input id="recInfo" type="text">
</body>
</html>
There we are.
You can use a form too:
<form action="somepage.htm" method="get">
<input type="text" id="sendInfo"/>
<input type="submit"/>
</form>
jscheuer1
07-28-2005, 12:33 AM
That would be:
<form action="somepage.htm" method="get">
<input type="text" name="sendInfo"/>
<input type="submit"/>
</form>Using id instead of name, as Twey did in his example will not send anything. Probably just an honest slip, I'm sure Twey knows better. I'm so unfamiliar with forms that I didn't even bother trying to figure it out. Once I saw Twey's example I thought, "Right, that's what I was trying to think of." So, I am grateful for the effort.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.