Markie
Posts: 251
|
| Posted: 11/27/2008, 6:47 AM |
|
At the moment I'm building a page which can make a zip archive of files in a folder. I want to show all the records of the database on this page and add a checkbox to each record. Visitors can check several boxes and the chosen files are added to the zip file.
The system to make zip files works smoothly, but at the moment I can only add one file to the zip.
I would like to know how I can add multiple files to an array, just by checking the checkboxes.
Markie
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 11/27/2008, 7:06 AM |
|
Markie
You have to make the checkbox a multiple item checkbox. The values will be added to the url as an array.
I have a post somewhere that sort of descibes this.
http://forums.yessoftware.com/posts.php?post_id=98742
Let me know if this helps
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
Gena
Posts: 591
|
| Posted: 11/27/2008, 9:27 AM |
|
To have a possibility to have one CheckBox for each row I use Editable grid.
So create a normal Editable grid and put some Checkbox. Then in AfterSubmit event you can get all checked checkboxes and process it as you need:
for($RowNumber = 1; $RowNumber <= $Container->TotalRows; $RowNumber++)
{
if ($Container->FormParameters["CheckBox1"][$RowNumber]==1 ) {
//here you have a CURRENT row with CheckBox1 checked
// you can get value you need like this, ProductPriceID is control name
$id = $Container->FormParameters["ProductPriceID"][$RowNumber] ;
}
}
_________________
Gena |
 |
 |
|