Tuesday, May 3, 2011

JavaScript: radiobutton names get a 0 at the end

Hi

I have a HTML form where which:

  1. clone a field set
  2. rename all radio button names in the set (they need to be unique so they are treated as a separate group after cloning).

When I inspect the DOM after the cloning, all the radiobuttons has a 0 at the end of the name string.

This happens in both Fx and IE, does anyone knows why?

I have off course checked and double checked my code :) When I do an alert before and after the renaming everything is as expected.

Thanks for answers,

regards bob

From stackoverflow
  • Oh boy! There was some other old shitty code that added the 0

    I knew before I started this that the whole thing should be refactored before I started this.

    Anyway, thanks for the reply!

    Arnis L. : I don't want to be rude, but in this case - you should delete your question. :)
    annakata : Seconded - this is waaaaay too localised to be of benefit to a future reader

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.