Logo Logo Nue Package
Getting Started Introduction
Getting Started Gulp
Getting Started Customization
Getting Started Credits
Getting Started Changelog
Design & Graphics Bootstrap Icons
Design & Graphics Illustrations
Components Accordion
Components Alerts
Components Avatars
Components Badge
Components Breadcrumb
Components Buttons
Components Button group
Components Cards
Components Collapse
Components Column divider
Components Devices
Components Divider
Components Dropdowns
Components Icons
Components List Group
Components Lists
Components Legend Indicator
Components Modal
Components Offcanvas
Components Page Header
Components Pagination
Components Popovers
Components Progress
Components Profile
Components Shapes
Components Sliding Image
Components Spinners
Components Steps
Components Tab
Components Toasts
Components Tooltips
Components Typography
Navbars Navbar
Navbars Navs
Navbars Mega Menu
Navbars Navbar Vertical Aside
Navbars Scrollspy
Tables Tables
Tables Datatables
Tables Sticky Header
Basic forms Basic forms
Basic forms Checks and switches
Basic forms Input group
Utilities Backgrounds
Utilities Borders
Utilities Colors
Utilities Links
Utilities Position
Utilities Rotations
Utilities Shadows
Utilities Sizing
Utilities Spacing
Utilities Z-index
Utilities Opacity
Advanced forms Advanced select
Advanced forms Datepicker
Advanced forms Date Range Picker
Advanced forms Calendar (Fullcalendar)
Advanced forms File attachments
Advanced forms Drag’ n’ drop file uploads
Advanced forms WYSIWYG Editor
Advanced forms Quantity counter
Advanced forms Copy to Clipboard
Advanced forms Input mask
Advanced forms Step forms (Wizards)
Advanced forms Wizards
Advanced forms Add field
Advanced forms Toggle password
Advanced forms Count characters
Advanced forms Form Search
Advanced forms Toggle switch
Advanced forms Google reCAPTCHA
Others Chart.js
Others Counter
Others Circles.js (Pie Chart)
Others Fullscreen Lightbox
Others Leaflet
Others JSVectorMap
Others SortableJS
Others Sticky block
Others Go To

No Results

  • Preview Demo
Logo Nµe
  • Nue
  • UI (HTML)
  • Getting Started
  • Introduction
  • Credits
  • Design & Graphics
  • Bootstrap Icons
  • Iconify Design
  • Illustrations
  • Components
  • Accordion
  • Alerts
  • Avatars
  • Badge
  • Breadcrumb
  • Buttons
  • Button Group
  • Cards
  • Collapse
  • Column Divider
  • Devices
  • Divider
  • Dropdowns
  • Icons
  • List Group
  • Lists
  • Legend Indicator
  • Modal
  • Offcanvas
  • Page Header
  • Pagination
  • Popovers
  • Progress
  • Profile
  • Shapes
  • Sliding Image
  • Spinners
  • Steps
  • Tab
  • Toasts
  • Tooltips
  • Typography
  • Navbars
  • Navbar
  • Navs
  • Mega Menu
  • Navbar Vertical Aside
  • Scrollspy
  • Tables
  • Tables
  • Datatables
  • Sticky Header
  • Basic Forms
  • Basic Forms
  • Checks & Switches
  • Input Group
  • Advanced Forms
  • Advanced Select
  • Datepicker (Flatpickr)
  • Date Range Picker
  • Calendar (Fullcalendar)
  • File Attachments
  • Drag n' Drop Uploads
  • WYSIWYG Editor
  • Quantity Counter
  • Copy to Clipboard
  • Input Mask
  • Step Forms (Wizards)
  • Add Field
  • Toggle Password
  • Count Characters
  • Form Search
  • Toggle Switch
  • Google reCAPTCHA
  • Charts
  • Chart.js
  • Counter
  • Circles.js (Pie Chart)
  • Others
  • Fullscreen Lightbox
  • Leaflet
  • JSVectorMap
  • SortableJS
  • Sticky Block
  • Go To
  • Utility
  • Backgrounds
  • Borders
  • Colors
  • Links
  • Position
  • Shadows
  • Sizing
  • Spacing
  • Z-Index
  • Opacity

Form Search

Form search plugin with clearing value options.

Cara Pakai

Copy-paste script berikut sebelum tag penutup <body>:

    
      <script>
        (function () {
          // INITIALIZATION OF FORM SEARCH
          // =======================================================
          new NueFormSearch('.js-form-search')
        })()
      </script>
    
  

Example

  • Preview
  • HTML
        
          <!-- Form -->
          <div class="mb-4 w-md-50">
            <div class="input-group input-group-merge">
              <input type="text" class="js-form-search form-control" placeholder="Search..."
                     data-nue-form-search-options='{
                       "clearIcon": "#clearIconBasicEg"
                     }'>
              <button type="button" class="input-group-append input-group-text">
                <i id="clearIconBasicEg" class="bi-x-lg" style="display: none;"></i>
              </button>
            </div>
          </div>
          <!-- End Form -->
        
      

Toggle icon

  • Preview
  • HTML
        
          <!-- Form -->
          <div class="mb-4 w-md-50">
            <div class="input-group input-group-merge">
              <input type="text" class="js-form-search form-control" placeholder="Search..."
                     data-nue-form-search-options='{
                       "clearIcon": "#clearIcon2",
                       "defaultIcon": "#defaultClearIconToggleEg"
                     }'>
              <button type="button" class="input-group-append input-group-text">
                <i id="clearIcon2" class="bi-x-lg" style="display: none;"></i>
                <i id="defaultClearIconToggleEg" class="bi-search" style="display: none;"></i>
              </button>
            </div>
          </div>
          <!-- End Form -->
        
      

Loading event

  • Preview
  • HTML
  • JS
        
          <!-- Form -->
          <div class="mb-4 w-md-50">
            <div class="input-group input-group-merge">
              <input type="text" class="form-control" id="type-loading" placeholder="Search..."
                     data-nue-form-search-options='{
                       "clearIcon": "#clearIconLoadingEg",
                       "defaultIcon": "#clearIconLoadingDefaultEg",
                       "loadingIcon": "#typeLoadingIconEg"
                     }'>
              <button type="button" class="input-group-append input-group-text">
                <i id="clearIconLoadingEg" class="bi-x-lg" style="display: none;"></i>
                <i id="clearIconLoadingDefaultEg" class="bi-search" style="display: none;"></i>

                <span id="typeLoadingIconEg" class="spinner-border spinner-border-sm text-primary" role="status" style="display: none;">
                  <span class="sr-only"></span>
                </span>
              </button>
            </div>
          </div>
          <!-- End Form -->
        
      
        
          <script>
            (function () {
               const clearTypeLoading = new NueFormSearch('#type-loading').getItem(0)

                clearTypeLoading.$el.addEventListener('input', function() {
                  clearTypeLoading.loading()

                  if (!clearTypeLoading.$el.value.length) {
                    clearTypeLoading.loading(false)
                  }
                })

                clearTypeLoading.$el.addEventListener('change', function() {
                  clearTypeLoading.loading(false)
                })
            })()
          </script>
        
      

  • Preview
  • HTML
  • JS
        
          <!-- Form -->
          <div class="mb-4 w-md-50">
            <div class="input-group input-group-merge">
              <input type="text" class="form-control" id="clear-input-loading" placeholder="Search..."
                     data-nue-form-search-options='{
                       "clearIcon": "#clearIconLoadingBtn",
                       "defaultIcon": "#defaultClearIconLoadingBtn",
                       "loadingIcon": "#loadingClearIcon"
                     }'>
              <button type="button" class="input-group-append input-group-text">
                <i id="clearIconLoadingBtn" class="bi-x-lg" style="display: none;"></i>
                <i id="defaultClearIconLoadingBtn" class="bi-search" style="display: none;"></i>

                <span id="loadingClearIcon" class="spinner-border spinner-border-sm text-primary" role="status" style="display: none;">
                  <span class="sr-only"></span>
                </span>
              </button>
            </div>
          </div>
          <!-- End Form -->

          <button id="loadBtn" class="btn btn-primary">Click for loading</button>
        
      
        
          <script>
            (function () {
              const clearInputLoading = new NueFormSearch('#clear-input-loading').getItem(0)
              const $loadingBtn = document.querySelector('#loadBtn')

              $loadingBtn.addEventListener('click', function() {
                $loadingBtn.setAttribute('disabled', true);
                clearInputLoading.loading()

                setTimeout(function() {
                  clearInputLoading.loading(false);
                  $loadingBtn.removeAttribute('disabled');
                }, 2000);
              })
            })()
          </script>
        
      

Drop menu

  • Preview
  • HTML
Recent searches
Gulp Notification panel
Tutorials
How to set up Gulp?
How to change theme color?
Members
Image Description
Amanda Harvey
Image Description
David Harrison
A
Anne Richard
See all results
        
          <div class="position-relative w-md-50 z-index-2">
            <!-- Form -->
            <div class="mb-4">
              <div class="input-group input-group-merge">
                <input type="text" class="js-form-search form-control" placeholder="Search..."
                       data-nue-form-search-options='{
                         "clearIcon": "#clearIconMenuEg",
                         "defaultIcon": "#defaultIconMenuEg",
                         "dropMenuElement": "#dropMenuEg",
                         "dropMenuOffset": 20
                       }'>
                <button type="button" class="input-group-append input-group-text">
                  <i id="clearIconMenuEg" class="bi-x-lg" style="display: none;"></i>
                  <i id="defaultIconMenuEg" class="bi-search" style="display: none;"></i>
                </button>
              </div>
            </div>
            <!-- End Form -->

            <!-- Drop Menu -->
            <div id="dropMenuEg" class="nue-form-search-menu-content dropdown-menu dropdown-menu-form-search navbar-dropdown-menu-borderless">
              <!-- Body -->
              <div class="card-body-height">
                <span class="dropdown-header">Recent searches</span>

                <div class="dropdown-item bg-transparent text-wrap">
                  <a class="btn btn-soft-dark btn-xs rounded-pill" href="../index.html">
                    Gulp <i class="bi-search ms-1"></i>
                  </a>
                  <a class="btn btn-soft-dark btn-xs rounded-pill" href="../index.html">
                    Notification panel <i class="bi-search ms-1"></i>
                  </a>
                </div>

                <div class="dropdown-divider"></div>

                <span class="dropdown-header">Tutorials</span>

                <a class="dropdown-item" href="../index.html">
                  <div class="d-flex align-items-center">
                    <div class="flex-shrink-0">
                      <span class="icon icon-soft-dark icon-xs icon-circle">
                        <i class="bi-sliders"></i>
                      </span>
                    </div>

                    <div class="flex-grow-1 text-truncate ms-2">
                      <span>How to set up Gulp?</span>
                    </div>
                  </div>
                </a>

                <a class="dropdown-item" href="../index.html">
                  <div class="d-flex align-items-center">
                    <div class="flex-shrink-0">
                      <span class="icon icon-soft-dark icon-xs icon-circle">
                        <i class="bi-paint-bucket"></i>
                      </span>
                    </div>

                    <div class="flex-grow-1 text-truncate ms-2">
                      <span>How to change theme color?</span>
                    </div>
                  </div>
                </a>

                <div class="dropdown-divider"></div>

                <span class="dropdown-header">Members</span>

                <a class="dropdown-item" href="../index.html">
                  <div class="d-flex align-items-center">
                    <div class="flex-shrink-0">
                      <img class="avatar avatar-xs avatar-circle" src="../assets/img/160x160/img10.jpg" alt="Image Description">
                    </div>
                    <div class="flex-grow-1 text-truncate ms-2">
                      <span>Amanda Harvey <i class="bi-patch-check-fill text-primary" data-toggle="tooltip" data-placement="top" title="Top endorsed"></i></span>
                    </div>
                  </div>
                </a>

                <a class="dropdown-item" href="../index.html">
                  <div class="d-flex align-items-center">
                    <div class="flex-shrink-0">
                      <img class="avatar avatar-xs avatar-circle" src="../assets/img/160x160/img3.jpg" alt="Image Description">
                    </div>
                    <div class="flex-grow-1 text-truncate ms-2">
                      <span>David Harrison</span>
                    </div>
                  </div>
                </a>

                <a class="dropdown-item" href="../index.html">
                  <div class="d-flex align-items-center">
                    <div class="flex-shrink-0">
                      <div class="avatar avatar-xs avatar-soft-info avatar-circle">
                        <span class="avatar-initials">A</span>
                      </div>
                    </div>
                    <div class="flex-grow-1 text-truncate ms-2">
                      <span>Anne Richard</span>
                    </div>
                  </div>
                </a>
              </div>
              <!-- End Body -->

              <!-- Footer -->
              <a class="card-footer text-center" href="../index.html">
                See all results <i class="bi-chevron-right small"></i>
              </a>
              <!-- End Footer -->
            </div>
            <!-- End Drop Menu -->
          </div>
        
      

Modal example

  • Preview
  • HTML
Form search
        
          <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">Open modal</button>

          <!-- Modal -->
          <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
            <div class="modal-dialog">
              <div class="modal-content">
                <div class="modal-header">
                  <h5 class="modal-title" id="exampleModalLabel">Form search</h5>
                  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>

                <div class="modal-body">
                  <!-- Form -->
                  <div class="mb-4">
                    <div class="input-group input-group-merge">
                      <input type="text" class="js-form-search form-control" placeholder="Search..."
                             data-nue-form-search-options='{
                               "clearIcon": "#clearIconModalEg"
                             }'>
                      <button type="button" class="input-group-append input-group-text">
                        <i id="clearIconModalEg" class="bi-x-lg" style="display: none;"></i>
                      </button>
                    </div>
                  </div>
                  <!-- End Form -->
                </div>

                <div class="modal-footer">
                  <button type="button" class="btn btn-white" data-bs-dismiss="modal">Close</button>
                  <button type="button" class="btn btn-primary">Save changes</button>
                </div>
              </div>
            </div>
          </div>
          <!-- End Modal -->
        
      

Methods

ParametersDescriptionDefault value
clearIconAn element that when clicked will clear the field. null
defaultIconThe element that will be the default instead clearIcon. null
loadingIconThe element that will be instead clearIcon and defaultIcon on loading. null
delayAnimation delay. 300
dropMenuElementDrop menu element. null
dropMenuOffsetDrop menu top offset. 0
activeClass Class which will be added when input search is active. null

Events

NameDescription
clearTriggered when the field is cleared