1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
<script type="text/javascript" >
$(document).ready(function() {
$("#select1").change(function(){
var select_name = $(this).attr("name");
var select_id = $(this).attr("id");
var my_select = $("#select1 option:selected");
//Récupération des valeurs du formulaires
var my_select_val = $("#select1 option:selected").val();
console.log(my_select_val);
if (my_select_val == 'all')
{
$(".output2").hide();
$(".output3").hide();
$(".output1").show();
}
if (my_select_val == 'nationality')
{
$(".output1").hide();
$(".output3").hide();
$(".output2").show();
}
if (my_select_val == 'tel')
{
$(".output1").hide();
$(".output2").hide();
$(".output3").show();
}
});
// ICI JE VOUDRAIS METTRE l'ID DE LA VALEUR PRE-SELECTIONNEE
$("select").change(function(){
return false;
}); // end DOM
</script> |
Partager