Skip to content

Use bootstrab dropdown as <select> to submit data form.

Notifications You must be signed in to change notification settings

Islam-alshiki/BS-Dropdown-Submit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Use bootstrab dropdown as <select> to submit data form.

Requirements

  • Bootstrab css
  • Bootstrab js
  • Jquery

Versions

Installation

/*
    after 
    * Jquery
    * Bootstrab js
*/
<script src="pathToPlugin/bs4-dropdown-submit-min.js">

Its run automatically after you configure it as shown in How _to_use section

How to use

Add [name] attribute to .dropdown div, Then plugin will use it to generate hidden <input> with this name, the value must be in .dropdown > ul > li > a [value], the selected text will be shown in <span class="inside"></span> in the button see Codepen.

  • add name attriute (sort)
  • add value attribute in link tag .dropdown > .dropdown-menu > a
<div class="dropdown" name="sort" >
    <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        ترتيب
        |
        
    </button>
    <div class="dropdown-menu">
        <a class="dropdown-item" href="#" value="1">المزاد ( الأقرب أولاً)</a>
        <a class="dropdown-item" href="#" value="2">المزاد(الأبعد أولاً)</a>
        <a class="dropdown-item" href="#" value="3">(الأقل أولاً)</a>
        <a class="dropdown-item" href="#" value="4">السعر (الأعلى أولاً)</a>
    </div>
</div>

About

Use bootstrab dropdown as <select> to submit data form.

Resources

Stars

Watchers

Forks