Topic: Select All option not giving proper values

Samra priority asked 1 year ago


I am trying to:

  1. send "" or null when "select all" is selected OR
  2. send comma separated values/text when "select all" is selcted

My code:

<select id="selCrashType" class="form-control select" multiple onchange="RefreshCrashMap()">
                                                    <option value="Head on" selected>Head on</option>
                                                    <option value="Intersection">Intersection</option>
                                                    <option value="Other">Other</option>
                                                    <option value="Rear end">Rear end</option>
                                                    <option value="Run off road">Run off road</option>
                                                    <option value="Vulnerable">Vulnerable</option>
                                                </select>

$('#selCrashType option:selected').text()

above code returns

Head onIntersectionOtherRear endRun off roadVulnerable


Mateusz Lazaru staff answered 1 year ago



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 5.0.0
  • Device: hp zbook
  • Browser: chrome
  • OS: wind
  • Provided sample code: No
  • Provided link: No