[thelist] Quirksmode Code Issue

Peter-Paul Koch gassinaumasis at hotmail.com
Sun Mar 28 08:04:40 CST 2004



>   I'm trying to use the dynamic-form-element-addition script from 
>http://www.quirksmode.org/dom/domform.html, and for some reason, its not 
>appending the "counter" to the field names (it is duplicating them).
>
>   I suspect that the error is because my form is actually inside a table, 
>and the childNodes that the script relies on (to generate the dynamic 
>names) are somehow not my form fields, but the <tr> <td> tags.
>
>   That's about as far as I got to debugging it :( My javascript+dom skills 
>are very rusty since I've been working exclusively in PHP-land for the past 
>two months.
>
>   Any help/suggestions would be nice.
>
>   The code is posted at http://www.meidomus.com/dev/eggdrop/index.php

The form fields are not direct children of the table id="dupes".

var newField = newFields.childNodes;

should become

var newField = newFields.getElementsByTagName('input');

-------------------------------------------------------------------
ppk, freelance web developer
Interaction, copywriting, JavaScript, integration
http://www.quirksmode.org/
Column "Keep it Simple": http://www.digital-web.com/columns/keepitsimple/
------------------------------------------------------------------

_________________________________________________________________
Talk with your online friends with MSN Messenger http://messenger.msn.nl/



More information about the thelist mailing list