Tinymce custom tag passing attributes

769 Views Asked by At

i have created a custom tag in tinymce. In that custom tag i want to pass name. so this is the code i tried

<field name="field">textbox</field>

Here if i get the final source generate by tinymce it has only

<field>textbox</field>

in the source data. I want to get the whole thing with the name as well in the source.

I refered this to make the custom tag Tiny MCE adding custom HTML tags.

1

There are 1 best solutions below

0
On

You can use an option to declare new valid elements and their attributes like:

tinymce.init({
    extended_valid_elements: 'field[name]'
});

you can play with this option like these possibilities:

extended_valid_elements: 'img[class=myclass|!src|border:0|alt|title|width|height|style]'