Auto Set Focus On Specific Form Field While Typing - cleverfocus

File Size: 4.78 KB
Views Total: 346
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Auto Set Focus On Specific Form Field While Typing - cleverfocus

cleverfocus is an intelligent autofocus jQuery plugin that enables a form element to automatically get focus when text is entered without a focus.

See Also:

How to use it:

1. Include the jquery.cleverfocus.js script after loading the latest jQuery library.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/jquery.cleverfocus.js"></script>

2. Call the function cleverfocus on the target form field and the plugin will do the rest.

<input type="text" id="search_input" value="" />
$(document).ready(function(){
  $('#search_input').cleverfocus({
    // options here
  });
});

3. Determine the minimum number of characters to trigger the autofocus function. Default: 0.

$(document).ready(function(){
  $('#search_input').cleverfocus({
    keypress_limit: 3
  });
});

 


This awesome jQuery plugin is developed by adw0rd. For more Advanced Usages, please check the demo page or visit the official website.