Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help - Table generated by javascript and reset by history.go(-1)

 
Alice Wong
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm new here!

I have a page which has a table. Whenever a link is clicked, a new row will be inserted by the following script:

function insRow()
{
var x=document.getElementById('Revenue').insertRow(-1)
var y=x.insertCell(0)
var z=x.insertCell(1)
var a=x.insertCell(2)
var b=x.insertCell(3)
var c=x.insertCell(4)
var d=x.insertCell(5)
y.insertAdjacentHTML("afterBegin", '<input type="text" name="textfield">')
z.insertAdjacentHTML("afterBegin", '<input name="code" type="text" id="code" size="5">')
a.insertAdjacentHTML("afterBegin", '<input name="fees" type="text" id="fees" size="15" >')
b.insertAdjacentHTML("afterBegin", '<input name="qty" type="text" id="qty" value="1" size="10" >')
c.insertAdjacentHTML("afterBegin", '<input name="amt" type="hidden" id="amt" value="0">')
d.insertAdjacentHTML("afterBegin", '<input type="checkbox">')
y.children(0).focus();
}


I have another link on this page which goes to another page and then return back to the original page by history.go(-1). However, after that the original page will be reset without the rows added. Is there anything I can do to prevent the reset? Thx!
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless you find some way to save the data (server side or cookie), there is nothing you can do.


(cookies are very limited to length so not a good idea)


Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic