When you come across problems like these it is a good idea to add some print statements to your script to see what is going on. So if you added some lines like this:
if ($query->param('submit1')){ my $family = $query->param('family'); my $TB = $query->param('TB'); my $LM = $query->param('LM'); my $HS = $query->param('HS'); my $SC = $query->param('SC'); my $AT = $query->param('AT'); print qq|TB: $TB<br>|; print qq|LM: $LM<br>|; print qq|HS: $HS<br>|; print qq|SC: $SC<br>|; print qq|AT: $AT<br>|;
You would see that if any of the checkboxes were ticked they have the value 'on' which is probably not what you want. So the problem is with your HTML - you could change the 'value' attribute of the checkbox to:
<input type="checkbox" name="TB" value="TB">Trypanosoma brucei<br> <input type="checkbox" name="LM" value="LM">Leishmania major<br> <input type="checkbox" name="HS" value="HS">Homo sapiens<br> <input type="checkbox" name="SC" value="SC">Saccharomyces cerevisiae<b +r> <input type="checkbox" name="AT" value="AT">Arabidopsis thaliana<br>
It is also a good idea to check the values from your form before passing the query to the database

In reply to Re: html checkbox and perl cgi by tangent
in thread html checkbox and perl cgi by AdrianJ217

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.