diff --git a/config/install/content_lock.settings.yml b/config/install/content_lock.settings.yml
index d816791..de20a0c 100644
--- a/config/install/content_lock.settings.yml
+++ b/config/install/content_lock.settings.yml
@@ -1,2 +1,3 @@
 verbose: 1
 types: {}
+types_js_lock: {}
\ No newline at end of file
diff --git a/config/schema/content_lock.schema.yml b/config/schema/content_lock.schema.yml
index 0b66fb1..9d6c80d 100644
--- a/config/schema/content_lock.schema.yml
+++ b/config/schema/content_lock.schema.yml
@@ -13,3 +13,6 @@ content_lock.settings:
         sequence:
           type: string
           label: 'Bundle type'
+    types_js_lock:
+      type: sequence
+      label: 'Entity types with JS lock on'
diff --git a/content_lock.libraries.yml b/content_lock.libraries.yml
new file mode 100644
index 0000000..eb5662f
--- /dev/null
+++ b/content_lock.libraries.yml
@@ -0,0 +1,7 @@
+lock_form:
+  js:
+    js/content-lock-form.js: {}
+  dependencies:
+    - core/jquery
+    - core/drupal
+    - core/jquery.once
\ No newline at end of file
diff --git a/content_lock.module b/content_lock.module
index 6ac39d0..56969bf 100644
--- a/content_lock.module
+++ b/content_lock.module
@@ -5,6 +5,7 @@
  * Content lock - Main functions of the module.
  */
 
+use Drupal\Component\Utility\Html;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Entity\EntityInterface;
@@ -81,6 +82,31 @@ function content_lock_form_alter(&$form, FormStateInterface $form_state, $form_i
     $form['actions']['submit']['#submit'][] = 'content_lock_form_submit';
     $form['actions']['publish']['#submit'][] = 'content_lock_form_submit';
 
+    if ($lock_service->isJsLock($entity_type)) {
+      $form['#attached']['library'][] = 'content_lock/lock_form';
+      $form['#attached']['drupalSettings']['content_lock'] = [
+        Html::cleanCssIdentifier($form_id) => [
+          'lockUrl' => Url::fromRoute('content_lock.create_lock.' . $entity_type, ['entity' => $entity->id()])->getInternalPath(),
+        ],
+      ];
+
+      // Do not allow deletion, publishing, or unpublishing if locked.
+      if (isset($form['actions']['delete'])) {
+        $form['actions']['delete']['#attributes']['class'][] = 'content-lock-actions';
+      }
+      if (isset($form['actions']['publish'])) {
+        $form['actions']['publish']['#attributes']['class'][] = 'content-lock-actions';
+      }
+      if (isset($form['actions']['unpublish'])) {
+        $form['actions']['unpublish']['#attributes']['class'][] = 'content-lock-actions';
+      }
+      // If moderation state is in use also disable corresponding buttons.
+      if (isset($form['moderation_state'])) {
+        $form['moderation_state']['#attributes']['class'][] = 'content-lock-actions';
+      }
+      return;
+    }
+
     // We lock the content if it is currently edited by another user.
     if (!$lock_service->locking($entity->id(), $user->id(), $entity_type)) {
       $form['#disabled'] = TRUE;
diff --git a/content_lock.routing.yml b/content_lock.routing.yml
index 033603b..1e744e1 100644
--- a/content_lock.routing.yml
+++ b/content_lock.routing.yml
@@ -1,5 +1,5 @@
 route_callbacks:
-  - '\Drupal\content_lock\Routing\BreakLockRoutes::routes'
+  - '\Drupal\content_lock\Routing\LockRoutes::routes'
 
 content_lock.content_lock_settings_form:
   path: '/admin/config/content/contentlocksettings'
diff --git a/js/content-lock-form.js b/js/content-lock-form.js
new file mode 100644
index 0000000..2b458f0
--- /dev/null
+++ b/js/content-lock-form.js
@@ -0,0 +1,63 @@
+/**
+ * @file
+ * Defines Javascript behaviors for the Content Lock button.
+ */
+
+(function ($, Drupal, drupalSettings) {
+
+  /**
+   * Behaviors for tabs in the node edit form.
+   *
+   * @type {Drupal~behavior}
+   *
+   * @prop {Drupal~behaviorAttach} attach
+   *   Attaches automatic submission behavior for content lock buttons.
+   */
+  Drupal.behaviors.contentLockButton = {
+    attach: function attach(context, drupalSettings) {
+      if (!drupalSettings.content_lock) {
+        return;
+      }
+
+      $.each(drupalSettings.content_lock, function (form_id, settings) {
+        $('form.' + form_id, context)
+          .once('content-lock')
+          .each(function () {
+            new Drupal.content_lock(this, settings);
+          })
+      })
+    }
+  };
+
+  Drupal.content_lock = function (form, settings) {
+    var that = this;
+
+    var ajaxCall = Drupal.ajax({
+      url: drupalSettings.path.baseUrl + settings.lockUrl,
+      element: form
+    });
+
+    ajaxCall.commands.insert = function () {
+      if (arguments[1].selector === '') {
+        arguments[1].selector = '#' + form.id;
+      }
+      Drupal.AjaxCommands.prototype.insert.apply(this, arguments);
+    };
+
+    ajaxCall.commands.lockForm = function (ajax, response, status) {
+      if (response.lockable && response.lock !== true) {
+        that.lock();
+      }
+    };
+
+    ajaxCall.execute();
+
+    this.lock = function () {
+      var $form = $(form);
+      $form.attr('disabled', 'disabled').addClass('is-disabled');
+      $form.find('input, textarea, select').attr('disabled', 'disabled').addClass('is-disabled');
+      $form.find('.content-lock-actions').remove();
+    };
+  };
+
+}(jQuery, Drupal, drupalSettings));
\ No newline at end of file
diff --git a/src/Ajax/LockFormCommand.php b/src/Ajax/LockFormCommand.php
new file mode 100644
index 0000000..fc932bd
--- /dev/null
+++ b/src/Ajax/LockFormCommand.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace Drupal\content_lock\Ajax;
+
+use Drupal\Core\Ajax\CommandInterface;
+
+/**
+ * Defines an AJAX command to lock current form.
+ *
+ * @ingroup ajax
+ */
+class LockFormCommand implements CommandInterface {
+
+  protected $lockable;
+
+  protected $lock;
+
+  public function __construct($lockable = FALSE, $lock = FALSE) {
+    $this->lockable = $lockable;
+    $this->lock = $lock;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function render() {
+    return [
+      'command' => 'lockForm',
+      'selector' => '',
+      'lockable' => $this->lockable,
+      'lock' => $this->lock,
+    ];
+  }
+
+
+}
diff --git a/src/ContentLock/ContentLock.php b/src/ContentLock/ContentLock.php
index 6c9ab5f..9b2e7ed 100644
--- a/src/ContentLock/ContentLock.php
+++ b/src/ContentLock/ContentLock.php
@@ -392,11 +392,13 @@ class ContentLock extends ServiceProviderBase {
    *   The entity type.
    * @param bool $quiet
    *   Suppress any normal user messages.
+   * @param string $destination
+   *   Destination to redirect when break. Defaults to current page.
    *
    * @return bool
    *   FALSE, if a document has already been locked by someone else.
    */
-  public function locking($entity_id, $uid, $entity_type = 'node', $quiet = FALSE) {
+  public function locking($entity_id, $uid, $entity_type = 'node', $quiet = FALSE, $destination = NULL) {
     // Check locking status.
     $lock = $this->fetchLock($entity_id, $entity_type);
 
@@ -432,7 +434,7 @@ class ContentLock extends ServiceProviderBase {
             $this->t('Break lock'),
             'content_lock.break_lock.' . $entity_type,
             ['entity' => $entity_id],
-            ['query' => ['destination' => $this->currentRequest->getRequestUri()]]
+            ['query' => ['destination' => isset($destination) ?  $destination : $this->currentRequest->getRequestUri()]]
           )->toString();
 
           // Let user break lock.
@@ -490,6 +492,17 @@ class ContentLock extends ServiceProviderBase {
   }
 
   /**
+   * Check if for this entity_type content lock over JS is enabled.
+   *
+   * @param $entity_type_id
+   *
+   * @return bool
+   */
+  public function isJsLock($entity_type_id) {
+    return in_array($entity_type_id, $this->configFactory->get('content_lock.settings')->get("types_js_lock"));
+  }
+
+  /**
    * Builds a button class, link type form element to unlock the content.
    *
    * @param string $entity_type
diff --git a/src/Controller/LockController.php b/src/Controller/LockController.php
new file mode 100644
index 0000000..26b3355
--- /dev/null
+++ b/src/Controller/LockController.php
@@ -0,0 +1,90 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: karl.fritsche
+ * Date: 23.10.17
+ * Time: 16:41
+ */
+
+namespace Drupal\content_lock\Controller;
+
+
+use Drupal\content_lock\Ajax\LockFormCommand;
+use Drupal\content_lock\ContentLock\ContentLock;
+use Drupal\Core\Ajax\AjaxResponse;
+use Drupal\Core\Ajax\AppendCommand;
+use Drupal\Core\Ajax\PrependCommand;
+use Drupal\Core\Controller\ControllerBase;
+use Drupal\Core\Entity\ContentEntityInterface;
+use Drupal\Core\Session\AccountInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpFoundation\Request;
+
+class LockController extends ControllerBase {
+
+  /**
+   * Content lock service.
+   *
+   * @var \Drupal\content_lock\ContentLock\ContentLock
+   */
+  protected $lockService;
+
+  public function __construct(ContentLock $lock_service) {
+    $this->lockService = $lock_service;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('content_lock')
+    );
+  }
+
+  /**
+   * Custom callback for the create lock route.
+   *
+   * @param \Symfony\Component\HttpFoundation\Request $request
+   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
+   *
+   * @return \Symfony\Component\HttpFoundation\JsonResponse
+   *
+   * @see \Drupal\content_lock\Routing\LockRoutes::routes()
+   */
+  public function createLockCall(Request $request, ContentEntityInterface $entity) {
+    $response = new AjaxResponse();
+
+    // Not lockable entity or node creation
+    if (!$this->lockService->isLockable($entity) || is_null($entity->id())) {
+      $lockable = FALSE;
+      $lock = FALSE;
+    }
+    else {
+      $lockable = TRUE;
+      $lock = $lockable ? $this->lockService->locking($entity->id(), $this->currentUser()->id(), $entity->getEntityTypeId(), FALSE, $entity->toUrl('edit-form')->getInternalPath()) : FALSE;
+
+      $status_messages = ['#type' => 'status_messages'];
+      $messages = \Drupal::service('renderer')->renderRoot($status_messages);
+      $response->addCommand(new PrependCommand('', $messages));
+
+      if ($lock) {
+        $unlock_button = $this->lockService->unlockButton($entity->getEntityTypeId(), $entity->id(), $entity->toUrl()->getInternalPath());
+        $response->addCommand(new AppendCommand('#edit-actions', $unlock_button));
+      }
+    }
+    $response->addCommand(new LockFormCommand($lockable, $lock));
+
+    return $response;
+  }
+
+  /**
+   * Custom access checker for the create lock requirements route.
+   *
+   * @see \Drupal\content_lock\Routing\LockRoutes::routes()
+   */
+  public function access(ContentEntityInterface $entity, AccountInterface $account) {
+    return $entity->access('update', $account, TRUE);
+  }
+
+}
\ No newline at end of file
diff --git a/src/Form/ContentLockSettingsForm.php b/src/Form/ContentLockSettingsForm.php
index 2a1d384..982ddcd 100644
--- a/src/Form/ContentLockSettingsForm.php
+++ b/src/Form/ContentLockSettingsForm.php
@@ -101,7 +101,7 @@ class ContentLockSettingsForm extends ConfigFormBase {
           $options[$bundle->id()] = $bundle->label();
         }
         if ($options) {
-          $form['entities'][$definition->id()] = [
+          $form['entities'][$definition->id()]['bundles'] = [
             '#type' => 'checkboxes',
             '#title' => $definition->getLabel(),
             '#description' => $this->t('Select the bundles on which enable content lock'),
@@ -109,6 +109,12 @@ class ContentLockSettingsForm extends ConfigFormBase {
             '#default_value' => $config->get('types.' . $definition->id()) ?: [],
           ];
         }
+        $form['entities'][$definition->id()]['js_lock'] = [
+          '#type' => 'checkbox',
+          '#title' => $this->t('Lock form using JS.'),
+          '#default_value' => in_array($definition->id(), $config->get('types_js_lock')),
+          '#description' => $this->t('Activating this options activates the lock when the user is on the form. This helps if modules interacting with form without a user interacting with the form, like the prefetch_cache module.')
+        ];
       }
     }
 
@@ -121,18 +127,27 @@ class ContentLockSettingsForm extends ConfigFormBase {
   public function submitForm(array &$form, FormStateInterface $form_state) {
     parent::submitForm($form, $form_state);
 
+    $content_lock = $this->config('content_lock.settings');
     $definitions = $this->entityTypeManager->getDefinitions();
     foreach ($definitions as $definition) {
       if ($definition instanceof ContentEntityTypeInterface && $definition->getBundleEntityType()) {
         if ($form_state->getValue($definition->id())) {
-          $this->config('content_lock.settings')
-            ->set('types.' . $definition->id(), $this->removeEmptyValue($form_state->getValue($definition->id())));
+          $content_lock->set('types.' . $definition->id(), $this->removeEmptyValue($form_state->getValue([$definition->id(), 'bundles'])));
+
+          $js_lock = (bool) $form_state->getValue([$definition->id(), 'js_lock']);
+          $types_js_lock = $content_lock->get('types_js_lock');
+          if ($js_lock && !in_array($definition->id(), $types_js_lock)) {
+            $types_js_lock[] = $definition->id();
+          }
+          elseif (!$js_lock && in_array($definition->id(), $types_js_lock)) {
+            $types_js_lock = array_diff($types_js_lock, [$definition->id()]);
+          }
+          $content_lock->set('types_js_lock', $types_js_lock);
         }
       }
     }
 
-    $this->config('content_lock.settings')
-      ->set('verbose', $form_state->getValue('verbose'))
+    $content_lock->set('verbose', $form_state->getValue('verbose'))
       ->save();
   }
 
diff --git a/src/Routing/BreakLockRoutes.php b/src/Routing/LockRoutes.php
similarity index 70%
rename from src/Routing/BreakLockRoutes.php
rename to src/Routing/LockRoutes.php
index 146f90d..5f32e49 100644
--- a/src/Routing/BreakLockRoutes.php
+++ b/src/Routing/LockRoutes.php
@@ -13,7 +13,7 @@ use Symfony\Component\Routing\Route;
  *
  * @package Drupal\content_lock\Routing
  */
-class BreakLockRoutes implements ContainerInjectionInterface {
+class LockRoutes implements ContainerInjectionInterface {
 
   protected $entityTypeManager;
 
@@ -43,7 +43,7 @@ class BreakLockRoutes implements ContainerInjectionInterface {
     foreach ($definitions as $definition) {
       if ($definition instanceof ContentEntityTypeInterface && $definition->getBundleEntityType()) {
         $routes['content_lock.break_lock.' . $definition->id()] = new Route(
-          '/admin/break-lock/' . $definition->id() . '/{entity}',
+          '/admin/lock/break/' . $definition->id() . '/{entity}',
           [
             '_form' => $definition->getHandlerClass('break_lock_form'),
             '_title' => 'Break lock',
@@ -60,6 +60,22 @@ class BreakLockRoutes implements ContainerInjectionInterface {
             ],
           ]
         );
+        $routes['content_lock.create_lock.' . $definition->id()] = new Route(
+          '/admin/lock/create/' . $definition->id() . '/{entity}',
+          [
+            '_controller' => '\Drupal\content_lock\Controller\LockController::createLockCall'
+          ],
+          [
+            '_custom_access' => '\Drupal\content_lock\Controller\LockController::access',
+          ],
+          [
+            'parameters' => [
+              'entity' => [
+                'type' => 'entity:' . $definition->id(),
+              ],
+            ],
+          ]
+        );
       }
     }
     return $routes;
