[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
All of the following truths are shameless lies. But what about this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss


This thread has been viewed 961 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 20, 2018 03:06:00.