in reply to html checkbox and perl cgi
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: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>|;
It is also a good idea to check the values from your form before passing the query to the database<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>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: html checkbox and perl cgi
by AdrianJ217 (Novice) on Jan 18, 2014 at 19:03 UTC | |
by AdrianJ217 (Novice) on Jan 18, 2014 at 19:45 UTC | |
by tangent (Parson) on Jan 18, 2014 at 20:30 UTC | |
by AdrianJ217 (Novice) on Jan 18, 2014 at 20:56 UTC | |
by tangent (Parson) on Jan 18, 2014 at 21:27 UTC | |
by AdrianJ217 (Novice) on Jan 18, 2014 at 22:48 UTC | |
|