Q: condition display value from a select box Hello Everyone I try to display a specific value in a form , from a select box . For exemple if i select "Arbitre Central" i would like to display 65 in the input text field to get the value in my controller . someone now how to achieve this ? 
thanks a lot in advance . 
by the way this technic works for me with radio button but not with select box option ! 
here is my form with the main idea to want i'm looking for but of course it doesn't work : 
<td>
    <div class="form-group">
        <select name="fonction" class="form-control select2" style="width: 100%;">
            <option name="choiceBareme" value="optionArbitreCentral">Arbitre Central</option>
            <option name="choiceBareme" value="optionJugeDeTouche">Juge de Touche</option>
            <option name="choiceBareme" value="optionDelegue">Délégué</option>
            <option name="choiceBareme" value="optionArbitreVideo">Arbitre Vidéo</option>
        </select>
    </div>
</td>
<td>
    <div class="conditional" data-cond-option="choiceBareme" data-cond-value="optionArbitreCentral">
        0
    </div>

    <div class="conditional" data-cond-option="choiceBareme" data-cond-value="optionJugeDeTouche">
        1
    </div>
</td>


A: Add new attribute in option for special_val which you want to reflect in input text on change
<select name="fonction" class="form-control select2" style="width: 100%;">
        <option name="choiceBareme" value="optionArbitreCentral" special_val="12">Arbitre Central</option>
        <option name="choiceBareme" value="optionJugeDeTouche"  special_val="912">Juge de Touche</option>
        <option name="choiceBareme" value="optionDelegue"  special_val="192">Délégué</option>
        <option name="choiceBareme" value="optionArbitreVideo"  special_val="62">Arbitre Vidéo</option>
</select>
<input type="text" value="" id="input_text" name="special_val">

and onchange call jQuery function 
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.0.min.js">
</script><script type="text/javascript">
$(document).ready(function() {
    $('.select2').on('change', function(){
        $("#input_text").val($('.select2 option:selected').attr('special_val'));
    });
});
</script>

check here : http://jsfiddle.net/0o368npa/

A: You could do it this way 


<script type="text/javascript">
var obj={optionArbitreCentral:65,optionJugeDeTouche:55,optionDelegue:46,optionArbitreVideo:68};
function displayVal(){
var val=document.getElementById('mySelect').value;
document.getElementById('myInput').value=obj[val];
}
</script>
<select id="mySelect" onchange="displayVal()" name="fonction" class="form-control select2" style="width: 100%;">
            <option name="choiceBareme" value="optionArbitreCentral">Arbitre Central</option>
            <option name="choiceBareme" value="optionJugeDeTouche">Juge de Touche</option>
            <option name="choiceBareme" value="optionDelegue">Délégué</option>
            <option name="choiceBareme" value="optionArbitreVideo">Arbitre Vidéo</option>
        </select>
   
<input id="myInput"/>


