CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Using checkbox to update fields

Print topic Send  topic

Author Message
Remy
Posted: 01/17/2004, 11:04 PM

Situation: mySQL weoth PHP 4.0 with Templates

- I have a table in mySQL ('persons') with a field called 'count' (amongst
other fields o.c.).
- I created a page with a grid of the table, and also with the field
'count' on it.
- Next I added a new control, a Checkbox. I place it in th egrid, sao that
each record will have a checkbox. I called the column: 'update'


What i want to achieve is that i have a button on the bottom of the record
list (th egrid), and when i click the button, all records where the checkbox
is checked, there the Count field is incremented by one.

Can anyone help me here? Im quite nerw to CCS, so dont be too complex :-)

Remy
Posted: 01/18/2004, 11:26 AM

Solved :-)
DataDoIt
Posted: 01/20/2004, 9:09 AM

What was the solution, if you don't mind.


"Remy" <Remy@forum.codecharge> wrote in message
news:5400addf7a3204@news.codecharge.com...
> Solved :-)
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Remy
Posted: 01/22/2004, 12:19 PM

Well, noty that difficult it turned out :P

1- Create editable grid
2 - Set allow update to true
3 - then set all field you do NOT want to update/editable to readonly
4 - Add a new Checkbox
4 - Look for UpdateRow function
5 - Change the following code:

$this->ds->DefCount->SetValue($this->DefCount->GetValue());

into:

if (!$this->CheckBox_Add->Value)
{$this->ds->DefCount->SetValue($this->DefCount->GetValue());}
else
{$this->ds->DefCount->SetValue($this->DefCount->GetValue() + 1);}

DefCount is the field i wanted to update; replace with your own field

gl

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.