=================
disable_edit_form
=================

.. js:function:: disable_edit_form()

**domain**: client 

**language**: javascript

**class** :doc:`Item class </refs/client/item_api>`

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

Call ``disable_edit_form`` to prevent any user actions when 
:doc:`edit_form <at_edit_form>` is visible.

Call 
:doc:`enable_edit_form <m_enable_edit_form>`
to re-enable edit form.

Example
=======

.. code-block:: js

  function on_edit_form_created(item) {
      var save_btn = item.add_edit_button('Save and continue');
      save_btn.click(function() {
          if (item.is_changing()) {
              item.disable_edit_form();
              item.post();
              item.apply(function(error){
                  if (error) {
                      item.alert_error(error);
                  }
                  item.edit();                
                  item.enable_edit_form();
              });
          }
      });
  }

See also
========

:doc:`enable_edit_form <m_enable_edit_form>`
