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

 ListBox and insert NULL

Print topic Send  topic

Author Message
amc

Posts: 22
Posted: 03/08/2013, 6:13 PM

Hi,

In a Record form, I have a ListBox with 3 possible values: 0 = "NO", 1 = "YES", 2 = "AUTO".

In one table of the database, I have a Boolean field that can be NULL (NO = FALSE, YES=TRUE, AUTO=NULL).

I managed to show AUTO in the ListBox when the field is NULL, working in the BeforeShow event of the ListBox.

But when I want to update (submit) the record I can't find the method to insert NULL, in the case the ListBox value is 2 (AUTO).

Thanks for your help!



View profile  Send private message
ckroon

Posts: 869
Posted: 03/18/2013, 2:55 AM

In the on validate event of the form
If( whatever)
{
$component->ListBox1->SetValue("");
}
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
amc

Posts: 22
Posted: 03/19/2013, 10:22 PM

Hi,

this code saves 0 to the DB, I want to save NULL.

View profile  Send private message
ckroon

Posts: 869
Posted: 03/20/2013, 1:44 AM

What is the default value for that field in your DB table.. set it to NULL
_________________
Walter Kempees...you are dearly missed.
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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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