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”
“
<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”
“
<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>