473,320 Members | 1,859 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,320 software developers and data experts.

Funky Remove

17
Hi,

Here's my form - it's still work in progress, but I got stuck with the Remove Item option.

http://www.steinrogan.com/SecureSite..._category.html

Here's my dilemma:

As long as I don't remove the very first Item, everything works as expected, i.e. I can add Dependant Items. But if I remove the first Item and add a Another Item, then the "Add a Dependant Item" button will not work.

Any ideas?

Thank you!

Csanád
Aug 4 '07 #1
8 1060
pbmods
5,821 Expert 4TB
Heya, Csanád.

Works great in Safari!

Instead of trying to dynamically create all those nodes, try cloning a template:

Expand|Select|Wrap|Line Numbers
  1. <div id="dolly" style="display:none;">
  2.     .
  3.     .
  4.     .
  5. </div>
  6.  
Expand|Select|Wrap|Line Numbers
  1. function createNode($i)
  2. {
  3.     var $newNode = document.getElementById('dolly').cloneNode(true);
  4.     $newNode.id = 'Element_' + $i;
  5.     $newNode.style.display = '';
  6.  
  7.     document.forms[0].appendChild($newNode);
  8. }
  9.  
You can clone and remove to your heart's content, and as long as your 'dolly' (get it?) is originally coded outside the main form, it will not be submitted with the form.
Aug 4 '07 #2
Csanád
17
Hello again :)

Here's my form:

http://www.steinrogan.com/SecureSite_v2_beta/new_category.html

Please do the following:

1. Add about 9 more New Items by clicking on the Add Another Item.

2. Go back to Item[1] and start removing the Item[1]. (Renumbering the following Items in the list is being done automatically, so for example, if you remove Item[2] from a list that has 4 Items, Item[3] and Item[4] will become Item[2] and Item[3], respectively.) Keep removing Item[1] and observe how the space between Category Name and Item[1] gets bigger.

3. Try to find and answer and please let me know. :)

Thank you!

Csanád
Aug 4 '07 #3
Csanád
17
Heya Pbmods,

For some reason cloning does not work for me. God knows I tried! After 3-4 hours of pain, I gave up and went with creating the nodes dynamically.

Everything works except for one thing. I posted a new thread in case you're interested. Subject: "Funky Remove - Take 2."

Thanks for your help!

Csanád
Aug 4 '07 #4
Csanád
17
Found it! :)

There was an extra <br> sibling hangin' there after removing its previous sibling, i.e. the Item that was being removed.

Cheers!

Csanád
Aug 5 '07 #5
pbmods
5,821 Expert 4TB
Heya, Csanád.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Aug 5 '07 #6
pbmods
5,821 Expert 4TB
Heya, Csanád.

Were you able to fix the remove problem then?
Aug 5 '07 #7
Csanád
17
Heya Pbmods,

Yes. I fixed it. Thanks for asking though!

Cheers,

Csanád
Aug 5 '07 #8
pbmods
5,821 Expert 4TB
Heya, Csanád.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Aug 5 '07 #9

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

Similar topics

7
by: Jonas Galvez | last post by:
Hi, I need a function to parse badly encoded 'Subject' headers from e-mails, such as the following: =?ISO-8859-1?Q?Murilo_Corr=EAa?= =?ISO-8859-1?Q?Marcos_Mendon=E7a?= I tried using the...
1
by: gene.ellis | last post by:
Put simply, I have a text box, and people commonly cut + paste information into this text box from Microsoft word. The problem is that word has all types of funky characters (smart quotes,...
6
by: Arne Claus | last post by:
Hi If've just read, that remove() on a list does not actually remove the elements, but places them at the end of the list (according to TC++STL by Josuttis). It also says, that remove returns a...
3
by: Tracy | last post by:
Just recently have I noticed that when we run our production application it is adding some funky directory to the address, (fwuhjo45ohmpj35552vwim55), which doesn't exist but it still works. This...
12
by: comp.lang.php | last post by:
I have a textarea where people can cut & paste their resume. Unfortunately they often cut & paste their Word resume into the textarea, funky characters and all. This causes the display to be...
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...
5
by: Russell Warren | last post by:
I've got a case where I'm seeing text files that are either all null characters, or are trailed with nulls due to interrupted file access resulting from an electrical power interruption on the...
1
by: dmh_test1 | last post by:
I have a view created in an adp which calls a UDF, also written in the adp, which simply contatenates some varchar fields based on some business logic and returns a varchar(50). The view looks...
1
by: Csanád | last post by:
Hello again :) Here's my form: http://www.steinrogan.com/SecureSite_v2_beta/new_category.html Please do the following: 1. Add about 9 more New Items by clicking on the Add Another Item.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.