473,394 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Remove loop code removes frame, but doesn't remove table

18
hi experts,
i'm developing a page in ASP but i'm doing also some javascript insode the page. i'm creating a frame and i want to loop this frame with a duplicateloop function so the form will be duplicate so many time, also i'm using a removeloop if the client want to remove the frame, in the html of the page i'm creating a table and i'm calling this loop, the problem now is that when i'm calling the removeloop it removes the frame but not the table in the html, so if i do the removeloop so many times the table will be big and big and big., how can i remove the table also when i'm calling the removeloop function.
second problem is that i'm calling an asp page inside the frame, i want to make the link to the css files dynamic but it seems that javascript does not alow that, in the asp page inside javascript function i'm calling also a function to get the same token of the page dynamically but it seems that it's not working.
any suggestions will be very appreciated.
i've been working in this now for 2 days.
thanks
Dec 6 '06 #1
2 1846
mrjoka
18
hi experts,
i'm developing a page in ASP but i'm doing also some javascript insode the page. i'm creating a frame and i want to loop this frame with a duplicateloop function so the form will be duplicate so many time, also i'm using a removeloop if the client want to remove the frame, in the html of the page i'm creating a table and i'm calling this loop, the problem now is that when i'm calling the removeloop it removes the frame but not the table in the html, so if i do the removeloop so many times the table will be big and big and big., how can i remove the table also when i'm calling the removeloop function.
second problem is that i'm calling an asp page inside the frame, i want to make the link to the css files dynamic but it seems that javascript does not alow that, in the asp page inside javascript function i'm calling also a function to get the same token of the page dynamically but it seems that it's not working.
here is the code for the remove loop and duplicate loop:
duplicateloop:
Expand|Select|Wrap|Line Numbers
  1. function duplicateLoop(nbr, useData){
  2.     var u;
  3.  
  4.     var ta = document.getElementById("loop"+nbr+"_0");
  5.     for (var i=0; i<ta.childNodes.length; i++ ) {
  6.         if (ta.childNodes[i].tagName == 'TBODY')
  7.             ta = ta.childNodes[i];
  8.     }
  9.     if (!useData) {
  10.         for (var i = 1; i <= nbrLoop[nbr]; i++) {
  11.             var f = getFrame('frame'+nbr+'_'+i);
  12.             }
  13.     }
  14.     nbrLoop[nbr]++;
  15.     var tr = document.createElement('TR');
  16.     var td = document.createElement('TD');
  17.     var i = document.createElement('IFRAME');
  18.     i.frameBorder=0;
  19.     //if (nbr==0) {
  20.         u = '/folder/folder2/page.asp?<%=asp function%>';
  21.         i.style.height = '480px';
  22.     //}
  23.     //u = u+nbrLoop[nbr]+'&getData='+useData;
  24.     i.src = u;
  25.     //alert(i.src);
  26.     i.id = 'frame'+nbr+'_'+nbrLoop[nbr];
  27.     i.style.width = '600px';
  28.     i.scrolling = 'no';
  29.     tr.id = 'tr'+nbrLoop[nbr];
  30.     td.appendChild(i);
  31.     tr.appendChild(td);
  32.     ta.appendChild(tr);
  33.     enumInputs(document.body);
  34. }
  35.  
remove loop:
Expand|Select|Wrap|Line Numbers
  1. function removeLoop(nbr,row){
  2.     var f = document.getElementById('frame'+nbr+'_'+row);
  3.     f.parentNode.removeChild(f);
  4.     for (var i = row+1; i <= nbrLoop[nbr]; i++ ) {
  5.         //var f = top.frames['frame'+nbr+'_'+i];
  6.         var f = getFrame('frame'+nbr+'_'+i);
  7.         //f.reNumber(i-1);
  8.         f = document.getElementById('frame'+nbr+'_'+i);
  9.         f.id = 'frame'+nbr+'_'+(i-1);
  10.     }
  11.     nbrLoop[nbr]--;
the code in html:
[HTML]<a id='makeNew' style='display:' href="javascript:window.parent.duplicateLoop(0);"> more + </a></td>
<span id="loop0span">
<table id="loop0_0" border="1"></table></span>
[/HTML]
any suggestions will be very appreciated.
i've been working in this now for 2 days.
thanks
Dec 6 '06 #2
acoder
16,027 Expert Mod 8TB
In the removeloop function, there's no code to remove the table or rows. Just as the duplicateloop function looped and appended table rows/cells, the removeloop also needs to loop and remove the rows using removeChild(). If you remove the rows, the frames will also be removed.
May 31 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: YT | last post by:
Howdy, Why the heck wouldn't this work: for each item in Session.Contents if NOT( Instr( item, "customer_" ) = 1 OR Instr( item, "user_" ) = 1 ) Then Session.Contents( item ) = ""...
1
by: frank | last post by:
I have two DataTables, A and B. Both have the primary key "CID". How do I remove all entries in Table A from Table B (with the same PK)?
6
by: Jonathan | last post by:
Hi. I'm having trouble figuring out what I should be doing here. I'm trying to remove an object from a list. The function is: void Alive::FromRoom () { list<Alive>::iterator iter =...
3
by: Niyazi | last post by:
Hi all, I have a dataTable that contains nearly 38400 rows. In the dataTable consist of 3 column. column 1 Name: MUHNO column 2 Name: HESNO Column 3 Name: BALANCE Let me give you some...
7
by: Susan Mackay | last post by:
I have a data table that is connected to a database table with a data adapter in the 'standard' manner. However I want to be able to remove selected rows from the data table (i.e. no longer...
10
by: pamelafluente | last post by:
Hi I have a sorted list with several thousands items. In my case, but this is not important, objects are stored only in Keys, Values are all Nothing. Several of the stored objects (might be a...
2
by: Konstantinos Pachopoulos | last post by:
Hi, i have the following string s and the following code, which doesn't successfully remove the "\", but sucessfully removes the "\\". .... if i!="\\": .... newS=newS+i .......
1
balabaster
by: balabaster | last post by:
Hi, I've been bashing my head against this since Friday and it's driving me nuts. I've got an EntitySet(Of T) (LINQ) which is serialized to/from the viewstate by overriding the LoadViewState and...
20
by: Nates | last post by:
I have a .bas file saved locally that I load into my Acces project to run a particular sub. I use the following code to load the module (which works fine): I use the following loop to remove...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.