CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Form defaults depending on selected record

Print topic Send  topic

Author Message

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 Box
Burningsuit Ltd
View profile  Send private message
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?

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:

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:

Or custom code with SQL:
Peter R.
YesSoftware Forums Moderator
For product support please visit
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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login

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