Code that allows to run in a web application that uses Knockout.js
Latest commit 09b7667 Aug 4, 2015 Michael Fromin Fixed typo in readme file.
Failed to load latest commit information.
binding Initial commit Jul 30, 2015
configurations Initial commit Jul 30, 2015
.gitignore Initial commit Jul 30, 2015
LICENSE.txt Initial commit Jul 30, 2015 Fixed typo in readme file. Aug 4, 2015

What does this do?

tl;dr provides a Knockout Binding that allows the WYSIWYG Rich Text Editor to be part of your <form> and participate in data binding like a normal <form> element would participate.


  • Knockout 3.x
  • 1.2+

If you need to use this with earlier releases of Knockout please contact us at


Implementing this custom binding is straightforward and simple.

Add the files to your project itself has a set of files that need to be available in your application in order for the directive to function properly. When you download you need to place the textboxio folder somewhere that is accessible to the user's browser at runtime. You need to make sure you have a <script> tag in your page that loads the textboxio.js JavaScript file. The remainder of this document assumes the files are in a web-accessible location and you already have a <script> tag in place loading the textboxio.js JavaScript file

Add the files from to your project

The 2 files provided need to be available to your application. Where you place them is up to you and there seems to be a multitude of "best practices" for how to organize your files in a web application that uses Knockout. The provided files are built for apps that use require.js for organizing their JavaScript files. This format is not required but is used (for example) in Durandal which is a popular SPA framework for use with Knockout.

If you are using require.js please make sure that you include the two provided JavaScript files in your requirejs.config and that you make them available as dependencies in any page that needs

If you are not using require.js you should be able to take the bindingHandler and configurations from these files and add them to your project as normal JavaScript. If you are unclear how to re-organize the files provided please contact us at

Data bind a <textarea> or <div> to the bindingHandler

The bindingHandler needs to be bound to a <textarea> or <div> within your form that uses Knockout. For example:

<textarea data-bind="textboxio:teaserContent, configuration:'simple'" rows="10" class="form-control" id="teaserContent" name="teaserContent"></textarea>

The textboxio:teaserContent portion of the data-bind tells Knockout to use this bindingHandler for the <textarea> - this is what causes to appear. The configuration:'simple' portion of the data-bind tells the binding handler to load a configuration property named "simple" from the configurations object. The configuration data-bind is purely optional but we expect that most people will want to provide a configuration file for that meets their specific needs.

The complete details on what this does

(when tl;dr is not enough!)

Knockout provides a built in two-way data binding between form (view) elements and the underlying (data) model. While this works well for standard form elements, Knockout does not know how to interact with

This is primarily due to the fact that “hides” the form field (<textarea>) and superimposes an iFrame over the form field. This means that when you are typing into you are not updating a Knockout aware view so the underlying model is not updated. When the form is submitted, the content of would not be included.

This Knockout binding handler solves this issue by managing the process of...

  • Deploying to the page
  • Managing the sync of data between and the Knockout model object