From 9fc3a3352254a031de6717ec2ae73c1c1020d984 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Mon, 23 Jan 2012 08:34:11 +0000 Subject: [PATCH] modification du JS --- public/themes/default/scripts/fields.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/public/themes/default/scripts/fields.js b/public/themes/default/scripts/fields.js index a1414815..aa7f7ad3 100644 --- a/public/themes/default/scripts/fields.js +++ b/public/themes/default/scripts/fields.js @@ -115,13 +115,21 @@ $(document).ready(function(){ /* Cacher le lien validé dans le cas ou les données ne sont pas coohérantes */ $('.intervalSelect').change(function(){ var key = $(this).attr('id'); - if($(this).val() > $('select[name='+key+'2] option:selected').val()){ - $('span#'+key).html('Donnée incohérantes') - }else if($(this).val() > $('select[name='+key+'2] option:selected').val()) { - + var number = $(this).attr('number'); + + if(number == 1) { + if($(this).val() > $('select[name='+key+'2] option:selected').val()){ + $('span#'+key).html('Donnée incohérantes') + }else { + $('span#'+key).html(' Valider'); + } + }else { + if($(this).val() < $('select[name='+key+'1] option:selected').val()){ + $('span#'+key).html('Donnée incohérantes') + }else { + $('span#'+key).html(' Valider'); + } } - else - $('span#'+key).html(' Valider'); }); $('#tabs').delegate('a.intervalSelect', 'click', function(e){