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

 Form defaults depending on selected record

Print topic Send  topic

Author Message
stuartb

Posts: 1
Posted: 01/19/2004, 1:22 AM

Hi all,

Using CCStudio, PhP and MySQL.

I'm building an application that has two main tables, call them "people" and "organisations", that have a one-to-one link. I've created a form that allows maintenance of the "people" records with a ListBox that selects the appropriate "organisation" record, and all works well.
But now I want to default fields on the "people" form with values from the selected "organisation" record, and I don't know how to go about it.
I realise it will mean a refresh of the form, as at the start when the form is first displayed we don't know which organisation record to use. However I haven't got an idea how this could be done. Any help to point me in the right direction would be great.

Many thanks

Stuart
_________________
Stuart Box
Burningsuit Ltd
View profile  Send private message
Alejandro
Posted: 01/19/2004, 2:15 PM

Why donīt you divide the form in a two step process, first for entering own values like name, etc and a second one to correct organization related values?
peterr


Posts: 5971
Posted: 01/19/2004, 2:38 PM

I suggest using JavaScript to automatically submit your form when the value of the ListBox changes:
http://www.google.com/search?q=%22submit+form%22+javascript+onchange

I guess you could have the ListBox in a separate Form or the same one.

The rest depends on your form structure. For example if the ListBox ("organisation") contains the key to your form/record, then probably the form will be refreshed automatically with the matching values. Otherwise you may use the BeforeShow event using the CCDLookup function:
http://docs.codecharge.com/studio/html/Components/Funct.../CCDLookUp.html
http://docs.codecharge.com/studio/html/ProgrammingTechn...gleDBValue.html

Or custom code with SQL:
http://docs.codecharge.com/studio/html/ProgrammingTechn...leDBValues.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
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.