/    Sign up×
Community /Pin to ProfileBookmark

Not Passing Info!!

Test page works great. Basically have my first page as:
<html>
<head>
<title>Test In</title>
</head>
<body>
<FORM NAME=”testform” action=”testout.php”>
<INPUT TYPE=”text” NAME=”firstfield”>
<INPUT TYPE=”text” NAME=”secondfield”>
<INPUT TYPE=”submit”>
</FORM>
</body>
</html>

Second page (testout.php) like this:

<html>
<head>
<title>Test Out</title>
</head>
<body>
<FORM NAME=”testform”>
<INPUT TYPE=”text” NAME=”firstfield”>
<INPUT TYPE=”text” NAME=”secondfield”>
</FORM>

<SCRIPT LANGUAGE=”JavaScript”><!–
function getParm(string,parm) {
// returns value of parm from string
var startPos = string.indexOf(parm + “=”);
if (startPos > -1) {
startPos = startPos + parm.length + 1;
var endPos = string.indexOf(“&”,startPos);
if (endPos == -1)
endPos = string.length;
return unescape(string.substring(startPos,endPos));
}
return ”;
}
var passed = location.search.substring(1);
document.testform.firstfield.value = getParm(passed,’firstfield’);
document.testform.secondfield.value = getParm(passed,’secondfield’);
//–></SCRIPT>

</body>
</html>

Everything passes to the other page fine. But when I try and use it on my real form (the complete code too long to post), I get nothing. It follows to the correct next page, but dosent even attempt to pass the info.

The other pages are basically the same, but the filenames are obvioulsy different. I made sure that the fieldnames match eachother also, there are just alot more of them than what I have on the test form. I also made sure the form names match (I dont know if that matters or not).

Any suggestions to check things?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@kelemvorFeb 16.2004 — Got a link to the live page?
Copy linkTweet thisAlerts:
@entropiauthorFeb 16.2004 — Yes.

10.11.12.69/lead_center.php
Copy linkTweet thisAlerts:
@Jeff_MottFeb 17.2004 — That address is broken (I don't know if anyone else has had better luck).

You already know the general case works (you said you've used it in other pages). So the cause of this problem is most likely not in the setup, but more likely the result of a typo or some kind of simple mistake. Also the reason why we can't do much more to help without seeing the real page.

Also, the code you currently have for parsing the query string will not work correctly for all valid query strings. This is not the cause of this particular problem, but something that should get straightened out nonetheless. See http://www.webdevfaqs.com/javascript.php#querystring for an alternative parser.
×

Success!

Help @entropi 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.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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