Commit 45e38c2e authored by Théo GUILLON's avatar Théo GUILLON
Browse files

Correction : création de la condition avec un champ déroulant et un multi-select

parent bee14bbd
......@@ -278,7 +278,7 @@ $line = 1;
// On cache le champ par défault
shownHideField(value['ifNot'], value['thenTheField']);
// Si le champ a comme balise "select" (deroulant)
// Si le champ a comme balise "select" (deroulant et multi dera)
if ($('#'+value['ifTheField']).is('select')) {
if ($('#'+value['ifTheField']).val() == value['hasValue']) {
shownHideField(value['mustBe'], value['thenTheField'])
......@@ -288,10 +288,18 @@ $line = 1;
// Quand le champ deroulant change de valeur
$('#' + value['ifTheField']).change(function () {
if (jQuery.inArray($(this).val(), value['hasValue'])) {
shownHideField(value['mustBe'], value['thenTheField'])
if ($('#'+value['ifTheField']).hasClass('multiSelect') == true) {
if (jQuery.inArray(value['hasValue'], $(this).val()) !== -1) {
shownHideField(value['mustBe'], value['thenTheField'])
} else {
shownHideField(value['ifNot'], value['thenTheField']);
}
} else {
shownHideField(value['ifNot'], value['thenTheField']);
if ($(this).val() == value['hasValue']) {
shownHideField(value['mustBe'], value['thenTheField'])
} else {
shownHideField(value['ifNot'], value['thenTheField']);
}
}
});
}
......@@ -337,7 +345,7 @@ $line = 1;
$('#' + thenTheField).parent().parent().show();
} else {
$('#' + thenTheField).parent().parent().hide();
$('#' + thenTheField).val('');
// $('#' + thenTheField).val('');
}
}
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment