Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

91
Views
Select2, Fixed Options

I'm wondering if there is a way to have fixed options on a multi-select select2 field without being able to remove them from the field.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use selected with disabled

$('select').select2({
  width: 'resolve',
  placeholder: 'This is my placeholder',
  disabled: true
});
console.log($('select').val())
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<select style="width: 75%" multiple>
  <option selected>option1</option>
  <option selected>option2</option>
  <option selected>option3</option>
</select>

To send the values ​​you will have to use javascript manually.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!