Hi,
I've used a multi-select text select list( called 'course prerequisites') in a CCK content type (to create a new course) that I created. 'course prerequisites' is a list by title of all existing courses. The user selects multiple values. When the course is edited, this multi-select text select list is shown as last saved....that is the entire list of course titles with highlighted values.
I' ve been trying to do this in a custom node module.
I've been able to automatically populate 'course prerequisites' with the title of all existing courses.
I've been able to create individual records in a table, prereqs(col1 --> nid, col2 --> prereqs) , for each value selected from the multi-select select list, 'course prerequisites'.
However, I've NOT been able to display the multi-select text select list as I would like.(...all course titles with the previously selected titles highlighted) when the node is in edit mode. Only the first item selected from the list is shown highlighted.
How do I do this ? I've been modifying node_load as shown below
function todo_load($node) {
$t = db_fetch_object(db_query('SELECT course_title FROM {prereqs} WHERE nid = %d', $node->nid));
return $t;
}
Obviously, only data items for the current node is retrieved.....and included in $node for display...
Ive tried this.....doesn't work..