Topic: Value for Dropdown selection not being posted on form Submit

AJEsler2019 priority asked 4 years ago


Expected behavior

I expect the value of a selected menu item to be POSTed when the form is submitted.

I have no JavaScript code acting on the dropdown menu item at this stage (eg to set a value on hide.bs.dropdown being triggered)

Actual behavior

I have tried naming all elements of the dropdown with none posted. The aaa, bbb and zzz elements of the code below are temporary intended to help me make it work. They were added progressively as I found the value not to be posted.

Resources (screenshots, code snippets etc.)

      <!-- Timeframe Range -->
      <div class="dropdown" name="aaaa">
        <button type="button" class="btn btn-primary dropdown-toggle" name="rRecommendationsTimeframe" id="rRecommendationsTimeframe" data-toggle="dropdown"
          aria-haspopup="true" aria-expanded="false">Most recent</button><label id="rRecommendationsTime">7 days</label>
          <!-- Timeframe Options -->
          <div class="dropdown-menu dropdown-primary" id="zzzz" name="zzzz">
            <a class="dropdown-item" name="bbbb" value="7">1 Week</a>
            <a class="dropdown-item" name="bbbb" value="31">1 Month</a>
            <a class="dropdown-item" name="bbbb" value="90">3 Months</a>
            <a class="dropdown-item" name="bbbb" value="183">6 months</a>
            <a class="dropdown-item" name="bbbb" value="365">1 Year</a>
            <a class="dropdown-item" name="bbbb" value="730">2 Years</a>
          </div>
      </div>

Grzegorz Bujański staff commented 4 years ago

Hi. I wonder why you won't try select instead of dropdown? Dropdown should be used as a drop down menu for navigation.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB jQuery
  • MDB Version: 4.18.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No