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

 Update fields from database when one changes

Print topic Send  topic

Author Message
twpeguin

Posts: 1
Posted: 01/20/2004, 12:01 PM

I need to know if there is a way to update fields on an ADD page when one of the others changes. For example, I enter a staff id in the field wo_staff_id. Is there a way to have the staff id be used to look up the employee in a table and enter the last name (lname) and first name (fname) when the staff id is not blank? Thanks for the assistance.
_________________
tammy
View profile  Send private message
peterr


Posts: 5971
Posted: 01/20/2004, 3:24 PM

Yes, there are two common approaches to implememt this.

One is to create server code that will create JavaScript with the list of all employees, so that all employees are stored in the HTML and when an ID is selected, the browser can immediately populate the values of the other fields.
An example of this functionality is on our "Knowledge Base" example (adm_kb_article_maint page) available to CCS users:
http://www.codecharge.com/ccsprojects/indexkb.php

Though you can probably find various JavaScript examples on the net:
http://www.google.com/search?q=javascript+onchange+populate+dynamically

The 2nd approach is to use simple JavaScript to automatically submit your form when the value of the 1st field changes. This is briefly discussed here:
http://forums.codecharge.com/posts.php?post_id=27226

An example of the 2nd implementation is available here:
http://support.codecharge.com/kb_article.asp?article_id=61
_________________
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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