Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TinyMCE textarea in modal form

I am trying to create form with some common inputs

<input type="text">

Now, I need to create textarea input because of more text input

<textarea>

I have not found any post about that. My code is bellow. Thanks for advices.

function(editor, type, name) {
    editor.windowManager.open( {
        title: 'Advert type: ' + name,
        body: [
        {
            type: 'textbox',
            name: 'target',
            label: 'Target',
            autofocus: true
        },
        {
            type: 'checkbox',
            name: 'blank',
            checked: true,
            label: 'Open in new tab'
        },
        {
            type: 'textbox',
            name: 'text',
            label: 'Main text',
            minWidth: '600',
        },
        {
            type: 'listbox',
            name: 'align',
            label: 'Text align',
            maxWidth: 100,
            values: [
                {
                    text: 'Left',
                    value: 'left',
                    icon: 'icon dashicons-align-left'
                },
                {
                    text: Right',
                    value: 'right',
                    icon: 'icon dashicons-align-right'
                },
                {
                    text: 'Cenetr',
                    value: 'center',
                    icon: 'icon dashicons-align-center'}
            ]
                }
        ],
        onsubmit: function(e) {
            editor.insertContent('[widget widget_name="TinyMCEAdvWidget" type="' + type + '" target="' + makeTarget(e.data.target) + '" blank="' + e.data.blank + '" text="' + e.data.text + '" align="' + e.data.align + '"]');
        }
    });
}

I would like to display the main text as textarea col=3.

like image 287
MakoBuk Avatar asked May 11 '15 09:05

MakoBuk


1 Answers

went through the same problem, you can use the following example:

{
  type: 'textbox',
  multiline: true
}
like image 164
Elvis Henrique Pereira Avatar answered Oct 09 '22 21:10

Elvis Henrique Pereira