Forum Moderators: open
To get a feel for what I am trying to do please see the link below. It is a script that is doing the same thing except using popup alert boxes, that then print the response in the spot I want them. I would like to eliminate the pop-up alert, and use textboxes instead.
<No URLs, thanks. See TOS [WebmasterWorld.com]>
Thank you for the help!
[edited by: DrDoc at 2:47 am (utc) on Jan. 4, 2005]
questionaire.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>My Questionaire</TITLE>
</HEAD>
<BODY>
<form action="results.html" method="get">
<input value="John Doe" name="name"> Your name<br>
<input value="25" name="age"> Your age<br>
<input value="Salt Lake City" name="location"> Where you live<br>
etc...<br><br>
<input type="submit" value="Submit data!">
</form>
</BODY>
</HTML>
results.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Results to the Questionaire</TITLE>
</HEAD>
<script language=javascript type="text/javascript">
<!--
function callInput(key)
{
if(window.location.href.indexOf(key+'=')!=-1)
{
a=window.location.href.split("?")[1].split(key+"=")[1].split("&")[0];/*The following will clean up the data*/
a=unescape(a);
a=a.replace(/\+/," ");document.write(a);
}
else
{
alert("Not all fields were filled. Please re-enter them.");
history.go(-1);
}
}
//-->
</script>
<BODY>
You can call the values of the form anywhere you want! Like here:
<script language=javascript type="text/javascript">
<!--
callInput("age")
//-->
</script>, which is the value of age. Or
<script language=javascript type="text/javascript">
<!--
callInput("name")
//--></script>, which is your name.
</BODY>
</HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Results to the Questionaire</TITLE>
</HEAD>
<script language=javascript type="text/javascript">
<!--
function callInput(key)
{
if(window.location.href.indexOf(key+'=')!=-1)
{
a=window.location.href.split("?")[1].split(key+"=")[1].split("&")[0];
/*The following will clean up the data*/
a=unescape(a);
a=a.replace(/\+/g," ");document.write(a);
}
else
{
alert("Not all fields were filled. Please re-enter them.");
history.go(-1);
}
}
//-->
</script>
<BODY>
You can call the values of the form anywhere you want! Like here:
<script language=javascript type="text/javascript">
<!--
callInput("age")
//-->
</script>, which is the value of age. Or
<script language=javascript type="text/javascript">
<!--
callInput("name")
//--></script>, which is your name.
</BODY>
</HTML>