modification du JS

This commit is contained in:
Damien LASSERRE 2012-01-23 08:34:11 +00:00
parent 6e0a6de368
commit 9fc3a33522

View File

@ -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('<span style="color:red;font-size:9px">Donnée incohérantes</span>')
}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('<span style="color:red;font-size:9px">Donnée incohérantes</span>')
}else {
$('span#'+key).html(' <span id="'+key+'"><a href="" class="intervalSelect" id="'+key+'">Valider</a></span>');
}
}else {
if($(this).val() < $('select[name='+key+'1] option:selected').val()){
$('span#'+key).html('<span style="color:red;font-size:9px">Donnée incohérantes</span>')
}else {
$('span#'+key).html(' <span id="'+key+'"><a href="" class="intervalSelect" id="'+key+'">Valider</a></span>');
}
}
else
$('span#'+key).html(' <span id="'+key+'"><a href="" class="intervalSelect" id="'+key+'">Valider</a></span>');
});
$('#tabs').delegate('a.intervalSelect', 'click', function(e){