My apologies,

I was playing with the code and changed something before sending...

Where it reads <INPUT TYPE=\"CHECKBOX\" SELECT NAME=\"$p[$trade]\" the array should 
actually read p$trade


----- Original Message ----- 
From: Michael Benbow 
Sent: Tuesday, July 03, 2001 7:02 PM
Subject: Processing checkboxes in Dynamic tables

I have a solution to my problem already, but I am looking for a far more economical 
way of doing this.

Currently my first page is four seperate tables with about 25 or so entries in each.  
I have gone through and automatically allocated the name p101 through p125 to the 
checkboxes for the first table, p201 through p225 to the checkboxes for the second 
table, etc.

The user makes selections from each table, but seldomly selects the majority.  They 
choose which lines they want processed then continue.

My problem is that with the above solution there are automatically 200 variables being 
passed from page to page, regardless of how many boxes are checked.  The average 
amount of boxes may be 10-15, and rarely is it more than 20.

Currently my code looks like the following...

  $result = mysql_query("SELECT * FROM $table_name WHERE ......");
  if ($row = mysql_fetch_array($result)) {

   do {
    echo "<tr bgcolor=\"#CBCFFF\">\n";
    echo "<td valign=\"top\" nowrap><font size=\"-2\">";
     echo "<INPUT TYPE=\"CHECKBOX\" SELECT NAME=\"$p[$trade]\" OPTION 
     echo $trade;
    echo "</td>\n";


    } while.....

Could someone please help me so only the variables which are checked before the submit 
button is pressed are parsed, eg p102, p107, p117, rather than every input variable 
which is initialised on the site?

Thank you heaps in advace,

Reply via email to