Click to See Complete Forum and Search --> : Form data persisting after populations from objects


Frank H. Shaw
June 2nd, 2005, 10:42 PM
This script is contaned in a child window we have no problem getting the correct text ie data to the objects in the form. the problem is we have a exact file saved to the desktop extension is .html when we double click on the desktop the form comes up in another browser and the same infomation text ie data is still in the form IT SHOULD HAVE NO DEFAULT INFORMATION in the form. this means what is happening? Are we getting some kind perstistant with the objects containing the data. Note: both browsers are open and displayed on the screen. What we want is one contains the data passed from the parent window the other should have cleared of information. I feel we need to destroy the objects and variables after populating the first form. Could you review the code below and explain how to do this or what you thank will solve our problem. THANKS

<BODY text=#000000 bgColor=#ffffff onload="getbakord();">

<form name=trans>
<input type=button name=info>
<input type=button name=fin>
</form>

<script>
var locate = window.location;
document.trans.info.value = locate;
var text = "document.trans.info.value";
var teva;
var gbo;

function delineate(str)
{
point = str.lastIndexOf("#");
return(str.substring(point+1,str.length));
}
delineate(text)
function getbakord()
{
var teva = "delineate(text)";
document.trans.fin.value = [teva]
if ("teva == eatme"){
var gbo = "Please notify me when U.S. DIVERS COZUMEL SEABREEZE SET is in stock!"
window.document.theform.selbox.value = "Backorder"
window.document.theform.comments.value = [gbo]
}
}
</script>

Dr. Script
June 2nd, 2005, 11:05 PM
Could you at load, loop and clear all the values of text boxes?<script type="text/javascript">

onload = function() {
var e = document.getElementsByTagName('input');
for(var i=0,a;a=e[i];i++) {
if(a.type == "text") a.value = "";
}
}

</script>That shoud work. If the for loop yields an error, he is the alternative/replacement: for(var i=0,a;i<e.length;i++) {
a = e[i];
if(a.type == "text") a.value = "";
}Hopefully this solves your problem temporarily. To get a permanent solution, I'll have to read your post again while I'm not half asleep ;) ...

Dr. Script