/    Sign up×
Community /Pin to ProfileBookmark

Problem Posting Results … :(

I have a form that submits results that are dynamically generated by javascript, it works well locally, but once I got it online, it fails “occasionally”, as if no results were generated, thus posting EMPTY results!! Why does this happen?? Is it the browser cache?? Please help me ?

//////////////// THE FORM – test.htm ////////////////

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
http://www.w3.org/TR/html4/loose.dtd“>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>

<script language=”JavaScript”>
v3 = 0; op = 0; ie4 = 0; ie5 = 0; nn4 = 0; nn6 = 0;
isMac = 0; aol = 0;
if(document.images){
if(navigator.userAgent.indexOf(“Opera”) != -1){
op = 1;
} else {
if(navigator.userAgent.indexOf(“AOL”) != -1){
aol = 1;
} else {
ie = (document.all)
ie4 = (document.all && !document.getElementById);
nn4 = (document.layers);
ie5 = (document.all && document.getElementById);
nn6 = (document.addEventListener);
}
}
} else {
v3 = 1;
}

if(nn4){
document.captureEvents(Event.KEYPRESS);
onkeypress = change;
}

if(navigator.userAgent.indexOf(“Mac”) != -1){
isMac = 1;
}
function appendText(){
result = “”;
result += “test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test “;
finalResult = ‘<textarea name=”textarea” cols=”32″ rows=”8″>’ + result + ‘</textarea>’;
if (ie5||nn6) {
document.getElementById(“toBeAppended”).innerHTML=finalResult;
}
else if (ie4) {
toBeAppended.innerHTML=finalResult;
}
}
</script>

<body>
<form method=”post” action=”catchAppendedResult.asp”>
<input name=”button” type=”button” onClick=”appendText()” value=”Append”>
<div id=”toBeAppended”></div>
<input name=”Submit” type=”submit” value=”Submit”>
</form>
</body>
</html>

//////////////// THE RESULT – catchAppendedResult.asp ////////////////

<% @LANGUAGE = VBScript %>
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
http://www.w3.org/TR/html4/loose.dtd“>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>

<body>
Appended Result = “<% = Request(“textarea”) %>”
</body>
</html>

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @afook 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 5.13,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...