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 'required' doesn't work CCS5.0

Print topic Send  topic

Author Message
arian

Posts: 11
Posted: 10/16/2012, 3:52 AM

Hi,
I have a record with a listbox control having as datasource a list of values (both values and descriptions are strings). Even if the 'required' option is set to 'yes', it still allow null values to be inserted into database.

Have you ever encounter this issue?
Any ideas?

Thanks,

Arian
View profile  Send private message
MichaelMcDonald

Posts: 640
Posted: 11/10/2012, 12:32 AM

It should work, but if it does not...unset required and use custom code in the on validate event:

if($Container->listboxname->GetValue() == NULL){
$Container->Errors->addError("Listbox is required");
}


You can also use < 1 or == 0 in place of NULL....
_________________
Central Coast, NSW, Australia.

View profile  Send private message
DataDoIT
Posted: 11/10/2012, 6:01 AM

For Listbox or Radio controls you're going to have to check for a value
using CCS's data validation rule.

Select your listbox, then in the Properties -> Data -> Validation Rule
put: CCStrLen($this->control_name->GetText() > 0

and then put in your Validation Text: "Value required dammit!"

The logic for the Validation Rule is 'if not this'. So we're checking
for 'if the string length of the field is not greater than zero'.

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.

MS Access to Web

Convert MS Access to Web.
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.