I have a code below, that embeds TinyMce Editor in a text area. See image below:
$form['myid_templates_editor']['text-modal'] = array( '#type' => 'text_format', '#title' => t('Description'), '#format' => 'full_html', '#prefix' => '<div id="myid_templates_editor_text_modal" class="myid_modal" title="Text Field">', '#suffix' => '</div>' );
How will I embed a text editor in a text area structured like the code below?
$form['myid_templates_editor']['text-modal'] = array( '#type' => 'item', '#markup'=> '<textarea></textarea>' );
My code needs to be structured that way for some reasons.
UPDATE 1
The reason why my code needs to be structured that way is because the textarea
element was embedded in a modal
div
invoke and made functioning by Jquery
. Below is my brief code:
$form['myid_templates_editor']['text-modal'] = array( '#type' => 'item', '#markup'=> '<div id="myid_templates_editor_text_modal" class="myid_modal" title="Text Field"><textarea></textarea></div>' );
Jquery Code:
//MyID Templates Editor Text Modal $("#myid_templates_editor_text_modal").dialog({ modal: true, height: 400, width: 600, buttons: { 'Ok': function(){ }, 'Apply': function(){ }, 'Cancel': function(){ } } });
My original code is much more complicated than the code above.