in reply to Checkbox parameter not being stored in CGI::Session

In my experience, there’s really only one sure-fire way to diagnose problems like this:   use the debugging facilities or plug-in of your favorite browser to LQQK at the HTTP GET/POST data that is being sent and that is being received.

Your <input type="checkbox" ...> tags do not have a value= attribute, and I suspect that this is the problem.   You would be able to instantly confirm (or disprove ...) this when you look at what your browser actually sends.

Replies are listed 'Best First'.
Re^2: Checkbox parameter not being stored in CGI::Session
by perlron (Pilgrim) on Oct 13, 2014 at 03:12 UTC
    yes thank you i did notice the value tag missing, just didnt think it was the best solution. Im glad you pointed it out.
      your suggestion to check post headers also was spot on. Even without using value tag, i see the solution is that the checkbox is not passed as a parameter when it is not selected. when selected checkbox value is set to 'on'. thanks.
Re^2: Checkbox parameter not being stored in CGI::Session
by perlron (Pilgrim) on Oct 16, 2014 at 18:16 UTC
    so i see now there is some quirk involved. and unchecked checkboxes are not passed in the session. im using a conditional check in my CGI::Application module to set checkbox to off if the query parameter is not available in the session.
    #checkbox needs a fix as it is not set in POST if unchecked if (!defined($query->param('c_scl'))){ $c_scl = 'off'; } else { $c_scl = $query->param('c_scl'); }
    If i dont do this, then i see that the fields in my template "after" the checkbox are not getting retrieved/ showing field names instead of field values in the html (sounds wierd) $self->tt_process('school_register.tt',\%ret_params);. I/m fairly certain there is a possible issue either in TT or in my TT code specifically, so i have to post this to the TT mailing list.