/    Sign up×
Community /Pin to ProfileBookmark

Help with Submitting Forms

hello..

this is as novice as novice can be.. ?
I’m testing some simple codes and still can’t get the results I want.

I made an html file with a submit button:
[B]<html>
<head>
</head>

<body>
<form action=”ReceivedInfo.htm” method=get name=form1>
<input type=”text” name=name>
<input type=”submit” value=”Submit” id=submit1 name=submit1></form>
</body>

</html>
[/B]

and then I read in a book the source code in which to receive this file the data included in another html form (ReceivedInfo.htm)… I’ve only copied the code, so I’m not sure if I’ve missed anything..

[B]<html>
<head>

<SCRIPT LANGUAGE=”JavaScript”>
function obtainValuesPassed()
{
var infoPassed = location.search;
infoPassed = infoPassed.replace(/+/g,” “);
infoPassed = unescape(infoPassed);
infoPassed = infoPassed.replace(/?/,” “);

var dataPairArray = infoPassed.split(/&|=/);
var extractedData = new Array();

for (var arrayIndex = 0; arrayIndex < dataPairArray.length; arrayIndex++)
{
extractedData[eatPairArray[arrayIndex]] = dataPairArray[++arrayIndex]
}
return extractedData;
}
var valuesPassed = obtainValuesPassed();
document.write(“Name is” + valuesPassed[“name”] + “<BR>”);
</script>
</head>
<body>
</body>
</html>[/B]

The result is a blank page. Please help.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorNov 10.2005 — maybe:
[code=php]
<script type="text/javascript">
onload=function(){
var infoPassed = location.search;
infoPassed = infoPassed.replace(/+/g," ");
infoPassed = unescape(infoPassed);
infoPassed = infoPassed.replace(/?/," ");

var dataPairArray = infoPassed.split(/&|=/);
var extractedData = new Array();

for (var arrayIndex = 0; arrayIndex < dataPairArray.length; arrayIndex++)
{
extractedData[eatPairArray[arrayIndex]] = dataPairArray[++arrayIndex]
}
document.getElementsByTagName('body')[0].innerHTML=extractedData.toString()
}
</script>
[/code]
Copy linkTweet thisAlerts:
@nerv_0034authorNov 10.2005 — Hello Kor.

Thanks for taking interest. ?

Unfortunately, it's still the same blank result... (sigh) ?
×

Success!

Help @nerv_0034 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...