I'm trying to make a simple calc usign values from input fileds, but I have a problem with passing values to if statement. It looks like this:
$('#confirmSila').click(function(){
var dlugosc = $('#sila').val();
var silaOd = $('.silaOd').val();
var silaDo = $('.silaDo').val();
if ((dlugosc > silaOd) && (dlugosc < silaDo))
{
//$('#orderWymiar').attr('value', dlugosc);
$('#sila').css('border', '1px solid green');
$('.silaInfo').text('Statement true');
}else{
$('#wymiar').css('border', '1px solid red');
$('.silaInfo').text('silaOd must be more than' + silaOd + ', and less than ' + silaDo);
}
});
And, the wird thing is that, when force is 20, JavaScript says that it passed the statemenst, when in input .silaOd is typed 100. (silaOd meand minForce, and sildaDo means maxForce in Poland)
I dont have any idea, why that is happening. Please help! :)
There's a working example: http://jsfiddle.net/rJA6U/