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

 set selected option in listbox from database - SOLVED!

Print topic Send  topic

Author Message
it--solutions


Posts: 24
Posted: 12/15/2014, 3:45 AM

I have found a way of setting a default <option selected value> in a listbox populated from a database

in this example my database structure & data is

table: common_list_data
id | list | bound | description | option_default
1 | jobs | Started | Started | 0
2 | jobs | Not Yet Started | Not Yet Started | 1

go about the normal way to populate the listbox from the database

then on the Properties window under events tab - right click on 'before show' and add custom code

  
$db = new clsDBdatabase();  
$job_status_default = CCDLookUP("description", "common_list_data", "list='jobs' and option_default='1'", $db);   
$add_jobs_record->job_status->SetValue($job_status_default);   
$db->next_record();   
$db->close();  
:-)
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.

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.