Get label of the plugin select2

Get label of the plugin select2

klermannklermann Posts: 246Questions: 62Answers: 1

Hello Allan, how do I get the text of the plugin select2, because the plugin is sending only the value in order and need to capture the value of the label. How should I do? I tried to do this: "conf._input.text(val)" only it returns the entire list.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 48,700Questions: 1Answers: 7,082 Site admin
    Answer ✓

    I don't know Select2 inside out I'm afraid - you might need to direct this question at their support channels, but try: conf._input.find('option:selected').text().

    Allan

  • klermannklermann Posts: 246Questions: 62Answers: 1

    Perfect, Thanks very much!!!!!

Sign In or Register to comment.