Formula not working
-
Hi there,
I can’t get the following formula to work.
Am i doing something wrong?<script type=”text/javascript”>
$(document).ready(function() {
$(“#x”).focusout(function(){
x = parseInt($(“#fieldname2”).val());
if( x < 29 ) {
a = 1;
} else {
a = Math.ceil(x / 30);
}$(“.new_a”).html(a);
});
$(“#fieldname3”).focusout(function(){
y = parseInt($(“#y”).val());
if( y < 29 ) {
b = 1;
} else {
b = Math.ceil(y / 30);
}$(“.new_b”).html(b);
});$(“#hesapla”).click(function(){
//alert(‘kk’);
var m = parseInt($(“#fieldname4”).val());
var sonuc = Math.ceil((((((a+b)/(x/100))/(y/100))))*m);
$(“.new_c”).html(sonuc);
return false;
});
});</script>
The topic ‘Formula not working’ is closed to new replies.