Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Test</title>
- <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
- </head>
- <body>
- <form>
- <div class="form-group">
- <label for="input1">Input</label>
- <input type="text" class="form-control" id="input1" placeholder="">
- </div>
- </form>
- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
- <script>
- $(document).ready(function(){
- var requested = false;
- $('#input1').on('keyup',function(){
- var count = $(this).val().replace(/\s/g, '').length;
- if (requested && count < 6) {
- requested = false;
- }
- if (count == 6 && !requested) {
- requested = true;
- console.log("Request");
- }
- });
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement