How to keep order of a multiple select in input

hello everyone, thank you for ur help,
so as you can see in the picture

i want to add some exercice choosen to my mission, the problem is that when i select an many exercice they stay in the same order they came with, for example when i select the third exercice first then the second exercice, they stay in the same order, i don’t know if u understood me. this is the code for the input :


<?php
echo $this->Layout->input(‘MissionExercice.exercice_id’, array( ‘options’ => $exercicespn, ‘multiple’=>‘multiple’, ‘class’=>‘select2’, ));
?>

to explain, i want to add those exercice in a specific order choosen by me, so that i can call them with that order by which I added them

That’s not how standard HTML select inputs work. There are various JavaScript “multi select” libraries that can do this sort of thing for you.