i have a grid / table in html form as followings code,:-
Expand|Select|Wrap|Line Numbers
- function addCritr(curno){
- var f = document.frmC5W002;
- // check val 1 & val 2 range
- if (f.txt_val1.value!="" && f.txt_val2.value!=""){
- if(parseInt(f.txt_val2.value)<=parseInt(f.txt_val1.value)){
- alert("Value 2 cannot be less than Value 1!")
- f.txt_val2.focus();
- return;
- }
- }
- curno = curno + 1;
- var grid = document.getElementById("CritrGrid");
- var numRows = grid.rows.length;
- grid.insertRow(curno);
- grid.rows[curno].insertCell(0);
- grid.rows[curno].insertCell(1);
- grid.rows[curno].cells[0].innerHTML = "<IMG SRC='../image/plussign.gif' onmouseover=this.style.cursor='hand' onclick='addCritr("+curno+")'>";
- grid.rows[curno].cells[1].innerText = curno;
- }
<TABLE cellspacing="1" cellpadding="1" id="CritrGrid" class="grid" ALIGN="center" width="95%">
<THEAD class="header">
<TH width="2%"> </TH>
<TH width="3%">SEQ</TH>
</THEAD>
<TR>
<TD>
<IMG SRC="../image/plussign.gif" onmouseover=this.style.cursor='hand' onclick="addCritr(1);">
</TD>
<TD>1</TD>
</TR>
</HTML>
[/HTML]
After i'd click on the "plussign.gif", it will call the function "addCritr()", and add 1 more row in grid "CritrGrid" using javascript (grid.rows[curno].insertCell(0); follow by grid.rows[curno].cells[0]....) ..
My question is after i'd add so many rows on the grid, and after i refresh the web page, all of the rows that i added using the javascript function will be become blank again..
how would i keep those rows & values after refresh the web page???
Anyone know bout these? Pls help!!!!~
Many Thanks ;-))