Field View Rendering

When a field’s view is rendered from a template, the render:view event is triggered on multiple channels.

An example of this in Ninja Forms is the rendering of the textarea field’s Rich Text Editor setting. See: RTE Example

Custom Example

In the below example, we listen on the textbox field type channel for the render:view event, and register a call back to the renderView() function. The callback for render:view receives the view as a parameter, which has access to the view’s model as a property.

The first line of the callback verifies that this is the correct view for our use case by checking the view’s model field key. From there we access the field element from the view.