I currently have a listbox on my page that is filled with values from a table.
admin.events.html.php
<?php mosEventsHTML::buildCategorySelect($row->catid, 'onChange="if(catColors[this.value])catColor=catColors[this.value]; else catColor=\'\';document.adminForm.useCatColor.onclick();"'); ?>
events.class.php
function buildCategorySelect($catid, $args){
global $database, $gid, $option;
$catsql = "SELECT id AS value, name AS text FROM #__categories"
. "\nWHERE section='$option' AND access<='$gid' AND published='1' ORDER BY ordering";
// get list of categories
$categories[] = mosHTML::makeOption( '0', _CAL_LANG_EVENT_CHOOSE_CATEG );
$database->setQuery($catsql);
$categories = array_merge( $categories, $database->loadObjectList() );
$clist = mosHTML::selectList( $categories, 'catid', $args, 'value', 'text', $catid );
echo $clist;
}
Also on the same page I have a couple of inputboxes. When a value is selected in the listbox I would like to have it fill my inputboxes with values from another table in my database using the field 'catid' where clause for my SELECT statement. I have no trouble with the sql part of this. my main trouble is more with the php. any help would be greatly appriciated.