[Logo]
Forums Register Login
JSP-Refresh
Hi!
I am dynamically creating table rows through a javascript function..evertime i give a page refresh the added rows disppear...how can i rectify the problem??
regards
Menon
could you please paste some relevent piece of code. that would help in getting the real problem.
Hope this makes sense




--------------------------------------------------

<table id="TimeTable" border="1" width="100%" cellpadding="2" >
<tr>

<th><bean:message key="USR_FORM_PROJNAME"/></th>
<th><bean:message key="USR_FORM_TASKNAME"/></th>
<th>Activity Name</th>
<th><bean:message key="USR_FORM_STARTTIME"/></th>
<th><bean:message key="USR_FORM_ENDTIME"/></th>

</tr>

On clicking an add button i add the rows dynamically as follows
var row = tbl.insertRow(lastRow);

var tbl = document.getElementById('TimeTable');
var lastRow = tbl.rows.length;


var cellRightProjName = row.insertCell(0);
var elProj = document.createElement('select');
elProj.setAttribute('name','projName');
elProj.onchange= function() {selectTask(document.TimeEntryAddForm,lastRow-1);};
for(var k=0;k<ProjLength;k++)
{
var optProj = new Option(ProjArray[k],ProjArray[k]);
elProj.options[elProj.length] = optProj;
}

cellRightProjName.appendChild(elProj);
-----------------------------------------------------



The rows which are dynaimaclly created get lost on refreshing...
Cld u pls tell me why
regards
Menon
You are going to loose them since they are in memory, you refresh the browser you loose the memory..

How to fix it? Track it server side with post backs or store it in a cookie...

Eric
Maybe he went home and went to bed. And took this tiny ad with him:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature


This thread has been viewed 931 times.

All times above are in ranch (not your local) time.
The current ranch time is
Apr 25, 2018 05:00:47.