They are grouped by name. They don't care one bit how the table is laid out beneath them, all the care about is the <input name="something">. Really, check the HTML source to debug.

But, I think your problem might be that you are having multiple boxes set as checked when generating the HTML.

...row1 <td><label><input type="checkbox" name="DOL" value="Ja" />Ja</label> +<label><input type="checkbox" name="DOL" value="Nej" checked="checked +" />Nej</label></td> ...row2 <td><label><input type="checkbox" name="DOL" value="Ja" />Ja</label> +<label><input type="checkbox" name="DOL" value="Nej" checked="checked +" />Nej</label></td>

So the name attribute matches but there are multiple checked. The browsers are required to pass each and every checked checkbox back. Did you want to use radio buttons or check buttons? (Even with radio buttons you might have these kinds of problems if the HTML you supply has multiple checked.)

I'm not really sure what you want since the code currently is fairly complex. You would benefit much if you made a new SOPW post with the bare minimum of code relevant to your problems, preferably one at a time. That, or create a HTML page with mere radio buttons / checkboxes and muck around it until it works. Then try to integrate that with your existing code.

BTW, having two submit buttons with the same name (spara) doing different things (saving and adding rows) is likely to lead to problems later on.


In reply to Re^3: Problems with CGI script behaviour by Anonymous Monk
in thread Problems with CGI script behaviour by SerZKO

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.