Compute function
<p>I have some problem with compute function. <br />
You can find code in HTML and jQuery here: <a href="http://jsfiddle.net/W7NHK/4/" rel="nofollow">http://jsfiddle.net/W7NHK/4/</a> <br /></p>

<pre><code>function compute() {
    var c = $('select#time_from_hour').val();
    var d = $('select#time_from_minute').val();
    var e = $('select#time_to_hour').val();
    var f = $('select#time_to_minute').val();
    var g = $('input#date_from').val();
    var h = $('input#date_to').val();
    var hour1 = g + ' ' + c + ':' + d;
    var hour2 = h + ' ' + e + ':' + f;

    hour1 = hour1.split("/");
    var hour1 = hour1[1]+","+hour1[0]+","+hour1[2];
    var timestamp = (new Date(hour1).getTime()/1000) + 7200;
    $('#total_hour1').val(timestamp);

    hour2 = hour2.split("/");
    var hour2 = hour2[1]+","+hour2[0]+","+hour2[2];
    var timestamp = (new Date(hour2).getTime()/1000) + 7200;
    $('#total_hour2').val(timestamp);

    var x = -$('input#total_hour1').val();
    var y = -$('input#total_hour2').val();
    var total_time = x - y;
    result = total_time / 86400;
    new_number = Math.ceil(result);

    if(isNaN(new_number)) {
        var new_number = 0;
    }
    $('#finish_day').val(new_number);   

    if ( parseInt($("#finish_day").val()) &lt; 4 ) {
        $('#get_car, #return_car').not(this)
            .children('option[value=' + this.value + ']')
            .attr('selected', true)
            .siblings().attr('disabled', true);
    }
    else {
        $('#get_car &gt; option, #return_car &gt; option').prop('disabled', false);
    }
}
</code></pre>

<p>Everything works fine, besides the compute function - when the value of <code>#finish_day</code> (Total day in form) is less then <code>4</code>, the options values in <code>#get_car</code> (City1 in form) and <code>#return_car</code> (City2 in form) are the same, and rest of options in <code>#return_car</code> are disabled. When the value of <code>#finish_day</code> is greater than <code>4</code> the all options values in <code>#return_car</code> are visible again, and that is OK.</p>

<p>The problem starts when i change values in <code>#return_car</code> and <code>#get_car</code> and after that I change the value in <code>#finish_day</code> back to value less than <code>4</code> (by Date field) - the options in <code>#get_car</code> and <code>#return_car</code> didn't change and values in <code>#return_car</code> are all visible and did't change to value from <code>#get_car</code>. It should be change by compute function, but it didn't.</p>

<p>Does anyone know why?</p>
