Page tree
Skip to end of metadata
Go to start of metadata

Create editor instances by replacing <textarea> or <div> elements with textboxio.replaceAll(). The initial content of the editor is set to the content/value of the replaced element.

When Textbox.io replaces a <textarea> element within a <form>, it will update the original <textarea> element when the form is submitted, supplying updated content as part of the <form> POST. 

When Textbox.io replaces <div> elements, content must be requested from Textbox.io using a JavaScript API, see: Get Editor Content.

Example

textboxio.replaceAll(selector, [options])
<textarea id="editor1">First Content</textarea>
<textarea id="editor2">Second Content</textarea>
...
// Create a Textbox.io editor by searching for textareas
var editors = textboxio.replaceAll( 'textarea' );
textboxio.replaceAll(elements, [options])
<div id="editor1">First Content</div>
<textarea id="editor2">Second Content</textarea>
...
// Create a Textbox.io editor by replacing the specific DOM elements
var div = document.getElementById('editor1');
var textarea = document.getElementById('editor2');
var editors = textboxio.replaceAll( [div, textarea] );

Parameters

selector

or

elements

String

or

Array

Specify a CSS3 selector representing the <div> or <textarea> element or elements you wish Textbox.io to replace for editing.

or

Specify an array of the <div> or <textarea> elements you wish Textbox.io to replace for editing.

configuration Object (optional)

An optional group of key-value pairs that specify options/settings for the Textbox.io instances you are invoking.

Returns

textboxio.editorArray

An array of Textbox.io editor instances. Each element matched with textboxio.replaceAll() creates a new instance of Textbox.io, which is then added to the returned array in order.

  • No labels