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

Read More
<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.

Related posts

Leave a Reply

1 comment