queryCheckbox always returns FALSE

View: New views
1 Messages — Rating Filter:   Alert me  

queryCheckbox always returns FALSE

by perry :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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


_______________________________________________
help-cgicc mailing list
help-cgicc@...
http://lists.gnu.org/mailman/listinfo/help-cgicc