473,657 Members | 2,453 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

18 New Member
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 1860
mrjoka
18 New Member
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="javascrip t: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 Recognized Expert Moderator MVP
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
3092
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 ) = "" Session.Contents.Remove( item ) end if next 'item
1
15735
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
2956
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 = room->living.begin(); while (iter != room->living.end()) {
3
5399
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 example first:
7
6601
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 include them in the set that is displayed to the user) but I don't want to delete the corresponding row from the database. I've tried using the .Rows.Remove() method but an exception is thrown to say I don't have a 'delete' command in the data...
10
6761
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 large number) have to be removed (say when ToBeRemoved = true). class SomeObj ToBeRemoved be a boolean field end class
2
6574
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 .... 'Sadasd\x07sd' I have also read the following, but i do not understand the "...and the
1
1822
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 SaveViewState methods. I've confirmed that this object is serialized/deserialized properly - so I know this bit is working as it should and when it should. I have created a table template in which I have a header row which is just header text for...
20
5780
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 the module: The above works fine (both adding the module and subsequantly removing it) provided I do not run any code within the module once it is loaded. The second I use code within the module the deletion loop does not seem to remove the...
0
8420
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8516
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.