Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Browsers / Internet Explorer / December 2005



Tip: Looking for answers? Try searching our database.

can an htm page read a url without asp?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rich - 07 Nov 2005 07:39 GMT
Hello,

On htm1.htm I have

<html>
<head><title>htm1.htm</title></head>
<body>
<form name="myFormA" action="htm2.htm" method="get">
 <input type="text" name="billy" size="70">
 <input type="submit" value="Submit">
</form>
</body>
<html>

and here is htm2.htm

<html>
<head><title>htm2.htm</title></head>
<body>
<form name="myFormB">
 <input type="text" name="axel" size="70">
</form>
</body>
<html>

Is it possible for htm2.htm to read the url passed in from htm1.htm without
using asp?  Without using a Response object - say just using javascript to
read the value pair?  If so, what would the javascript code look like?

Thanks,
Rich
davehagemann@gmail.com - 06 Dec 2005 04:42 GMT
Rich,
Here's all you have to do...
For htm1.htm:
<html>
<head><title>htm1.htm</title></head>
<body>
<form name="myFormA"
action="htm2.htm?var1=document.myFormA.billy.value" method="get">
 <input type="text" name="billy" size="70">
 <input type="submit" value="Submit">
</form>
</body>
<html>

And for htm2.htm:
<html>
<head>
<title>htm2.htm</title>
<script language="javascript">
function loadvalue()
{
// Set the Search text from the querystring
var strQuerystring = window.location.search.substring(1);
var strNameValuePairs = strQuerystring.split("&");
if (strNameValuePairs.length >= 1)
{
    strNameValuePairs = strNameValuePairs[0];
    var intPos = strNameValuePairs.indexOf('=');
    if (intPos >= 0)
    {
        var strName = strNameValuePairs.substring(0, intPos);
        if (strName == 'var1')
        {
            var strValue = strNameValuePairs.substring(intPos + 1);
            document.myFormB.axel.value = unescape(strValue);
        }
    }
}
}
</script>
</head>
<body onload="loadvalue()">
<form name="myFormB">
 <input type="text" name="axel" size="70">
</form>
</body>
<html>

Hope that helps.
- Dave
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.