=============
create_inputs
=============

.. js:function:: create_inputs(container, options) 

**domain**: client 

**language**: javascript

Description
===========

Use ``create_inputs`` to create data-aware visual controls (inputs, checkboxes) 
for editing 
:doc:`fields <at_fields>`
of the item.

This method is usually used in the ``on_edit_form_created`` events.

The following parameters are passed to the method:

* ``container`` - a JQuery object that will contain visual controls, if 
  container length is 0 (no container), the method returns.

* ``options`` - options that specify how controls are displayed

The ``options`` parameter is an object that may have following attributes:

* ``fields`` - a list of field names.  If specified, a visual control will be 
  create for each field whose name is in this list, if not specified then the 
  ``fields`` attribute of 
  :doc:`edit_options <at_edit_options>` 
  will be used (if defined), otherwise the layout, created in the 
  :doc:`Edit Form Dialog </admin/items/edit_form_dialog>` of
  Application builder, will be created

* ``col_count`` - the number of columns that will be created for visual controls, 
  the default value is 1, 
  

Before creating controls the application empties the container.

Example
=======

.. code-block:: js

    function on_edit_form_created(item) {
    	item.create_inputs(item.edit_form.find(".left-div"), 
    	    {fields: ['firstname', 'lastname', 'company', 'support_rep_id']}
    	);
    }

See also
========

:doc:`fields <at_fields>`

:doc:`Data-aware controls </programming/interface/data_controls>`

:doc:`create_edit_form <m_create_edit_form>`


