My advice: throw CGI.pm's stupid HTML wrappers away and write HTML directly. They are not worth it. There's no black box in front of you if you bother to write the forms directly. The only thing CGI.pm is useful for is accessing HTTP headers and query params. [1] Anyway, I'll let you on a secret. The #1 debugging tool in web programming. Ctrl-U (View Source).

Then I thought it might be a good point to use radio buttons instead. And when I add those lines of code, then I was able to click only one radio button per column and not per row as I expected (as all td's are mapped within Tr) ?!!? What am I missing here ?

Radio buttons are grouped based on their name attribute.

Another question is the behaviour of the checkbox group (named GRU in my case) where I would like "Ej" box to be unchecked if any(or more) of the previous boxes are checked - could I use onCheck here and how ? Or even better, is it possible to "make" checkboxes send a name even if they don't have a value (undef) ?

If you want only one of them to be checked, use radio buttons. oncheck is javascript and is dependent on the client browser to work. (Bad idea in my opinion, but seeing the current trends in web development, I'm in the minority.)

Checkboxes (or radio buttons) aren't submitted with the form if none are selected. You can default your params like this: $q->param(GRU => "Ej") unless $q->param('GRU');

I was trying to add a row to this table by clicking button "Addera rad". My idea was to add en empty row to a file I'm reading the table from and then call subroutine again. And it works so long that "empty" csv row is created in a file. But then, when I recall this subroutine, I get only one (first) row of a file. What am I missing here ?

Du måste addera din rad to the loop. Your loop is dependent on the file handle TEMP currently. It won't generate a single row after that. I'm afraid I'm not sure how to help there since the code looks pretty much a mess thanks to CGI.pm. (There's a map where usually a for loop would be.)

[1] Okay, I'll give it one more. It's okay for doing form prefills.


In reply to Re: 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.