I have a custom form with an editor element for a "Description" field. The editor should default to the description already stored on the database. In my form file, I read the database and save the description to a variable called $description. In the file that calls the form, I set the variable as follows:
$mform = new statementForm_form(null, array('description'=>$description));
In the form file, I then call the $description variable in $mform as follows:
$mform->addElement('editor', 'description', 'Course Description');
I can get it to work and display if use the words "Default Text" instead of the $desc variable on the default line but I want it to display the actual data from the database.
Can anyone tell me what I am missing?