J
|
Jane 2/14/2008 |
Hi, |
M
|
mrphp author 2/14/2008 |
Hi, use dependent dropdown boxes for this purpose. Also I recommend you to have a look at the "How to setup dependent dropdown boxes on Edit/Add pages" PHPRunner tutorial: http://www.xlinesoft.com/phprunner/php-database.htm
|
J
|
Jane 2/14/2008 |
Hi, global $conn; $str = "select name from jobnumbers where IDfield=".$values["jobno"]; $rs = db_query($str,$conn); if ($data = db_fetch_array($rs)) $values["jobname"] = $data["name"]
|
M
|
mrphp author 2/14/2008 |
Hi, JobName is redundant field in the subcontacts table. I recommend you to use only jobno field on the add/edit page of subcontacts table and fill it with correct ID from jobnumbers table. Setup number as link field and name as display field for jobno field on the "Edit as" settings dialog on the Visual Editor tab. Also you can fill jobname field with correct value in the Before record added event on the Events tab. Here is a sample: where IDfield is your actual field name.
|
J
|
Jane 2/15/2008 |
Sorry for my fault. global $conn; $str = "select name from jobnumbers where number=".$values["jobno"]; $rs = db_query($str,$conn); if ($data = db_fetch_array($rs)) $values["jobname"] = $data["name"]; return true; |