CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Filtering data from listbox in an editable grid form

Print topic Send  topic

Author Message
Justman
Posted: 01/12/2005, 4:08 PM

Hi All,

I have a list box in an editable grid. And I want to confirm that each selection in the listbox has NOT been entered into the database before allow insert. This is to avoid double entry of the same value into a table.

My problem is how I can iterate through each listbox and compare the value against the one in the database if it exists.


global $myeditable_grid;
global $mysearch1;
global $DBconn;


$exits_c = CCDLookUp("product_id", "product_group", "product_id =". $DBconn->ToSQL($mysearch1->product_id->GetValue(), ccsInteger), $DBconn );

// HOW CAN I GET THE ARRAY NUMBER FOR EACH LISTBOX CONTROL AND EVALUATE THE VALUE AGAINST THE VALUE FROM THE DATABASE BEFORE ALLOW INSERT ?


foreach($exits_c..........) //ERROR

if (($exits_c == $myeditable_grid->product_id->GetValue())
{

$myeditable_grid->InsertAllowed = false;
$myeditable_grid->Errors->addError("Sorry ". $$exits_c . " is already in the system. You can't add it twice");
}


Any help would be highly appreciated. Thanks.

Justman

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.