View Full Version : displaying
hughesmi
11-07-2002, 01:53 PM
Can someone show me how to take a value and pass to dislay as text on a page.
so maybe using a simple text box and entering a value and then submiting it to display what was typed there.
ShriekForth
11-07-2002, 03:56 PM
This is about as simple as it gets, unless you use a server side language to post the variables to, PHP, CGI, ASP, whatever. This will only take the first argument, and display it.
parse.html
<html>
<head>
<script type="text/javascript" language="JavaScript">
function getID(){
var str = new String(document.location);
vars = str.split("=");
if (vars.length >1)
return vars[1];
else
return "Enter Something Below"
}
</script>
<title>BlankPage</title>
</head>
<body>
<script type="text/javascript" language="JavaScript">
document.write(getID() + "<br>");
</script>
<form name="temp" method="get" action="parse.html">
<input type="text" name="MyField" value=""><br>
<input type="submit">
</form>
</body>
</html>
That should give you something to work from anyway. Right now it just posts to itself.
ShriekForth
hughesmi
11-08-2002, 09:17 AM
thanks for this, but i coulnt get this to work.
ShriekForth
11-08-2002, 03:12 PM
Did you save it as parse.html?
ShriekForth
hughesmi
11-11-2002, 08:56 AM
Just call me a dum ***, thanks its working fine now.
:-)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.