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

94
Views
Select2, opciones fijas

Me pregunto si hay una manera de tener opciones fijas en un campo select2 de selección múltiple sin poder eliminarlas del campo.

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

0

Puede usar selected con 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>

Para enviar los valores tendrás que usar javascript manualmente.

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!