CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [Solved] Action only after checkbox = checked

Print topic Send  topic

Author Message
Markie


Posts: 251
Posted: 01/14/2009, 2:40 AM

I have an Editable grid with a.o. a checkbox. The name of the checkbox is coverphoto.
the grid has this After Submit custom code:

$Filename = $Container->Filename->GetValue();
$user = $Container->user->GetValue();
$files = $Container->files->GetValue();
copy("users/$user/$files/$Filename", "users/$user/$files.jpg");

The code works perfectly, but it does everytime when the Submit button is clicked. I want to perform the copy command only after the checkbox is checked. I know this is probably easy, but I can't find the solution.

_________________
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
View profile  Send private message
datadoit
Posted: 01/14/2009, 1:16 PM

if ($Container->YourCheckbox->GetValue() == 1) {
$Filename = $Container->Filename->GetValue();
$user = $Container->user->GetValue();
$files = $Container->files->GetValue();
copy("users/$user/$files/$Filename", "users/$user/$files.jpg");
}
Markie


Posts: 251
Posted: 01/15/2009, 9:23 AM

great, thanks !
_________________
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.