help-cgicc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[help-cgicc] queryCheckbox always returns FALSE


From: Perry Howell
Subject: [help-cgicc] queryCheckbox always returns FALSE
Date: Tue, 15 May 2007 14:29:57 -0500

Hello all, first timer here so forgive any and all ignorance you will see.

 

200 check boxes in form. Page generated using MS Publisher.

Script in C++ called on Submit.

Most of the Cgicc function are working for me.

 

However, the queryCheckbox() function will always return FALSE regardless whether the check box is checked or not.

Here is a code snippet:

  char strig[20];
  string value, temp, temp1, temp2, temp3,temp4;
 
int i;
  form_iterator name,stemp1, stemp2, stemp3,stemp4;

      for(i=0;i<MAX_FREQS;i++)
     
{
            sprintf(strig,
"LC_CHECK_BOX_%d",i+1);
            temp
=strig;
           
if(cgi.queryCheckbox(temp))
                  temp1
="0";
           
else

temp1="1";

             fprintf(in,"temp1 %d %s\n",i+1,temp1.c_str());
      }

My questions:

1)       When the checkbox is NOT selected, the environment variable for that checkbox is not in the environment variable list. I’m using the “dumpList()” routine to show the list and any checkbox NOT checked will not have a variable in the list. Is this normal? If so, how does queryCheckbox handle a missing variable name?

2)       I’m writing the input from the webpage to file for use later, but the code snippet produces a FALSE Boolean from queryCheckbox(), even when the box is checked. What am I doing wrong?

 

Thanks to all

 

Perry


reply via email to

[Prev in Thread] Current Thread [Next in Thread]