I’m starting over here…
I have this function…
$('.Discount').live({
focusout: function() {
var $tr = $(this).closest('tr');
var CustDiscount = $('#CustDiscount:eq(0)').val();
var DiscountIS = $('.DiscountIS:eq(0)', $tr).val();
if ((CustDiscount) > (DiscountIS)) {
(Discount) = (CustDiscount);
} else if
((DiscountIS) > (CustDiscount)) {
(Discount) = (DiscountIS);
} else if
((DiscountIS) = (CustDiscount)) {
(Discount) == (CustDiscount);
}
$('.Discount:eq(0)', $tr).val(Discount);
}
});
There is a .live function that will use the value of the Discount after that var is established. If the user tabs past the .Discount field the above function puts in the (Discount) based on the function. Now, what I would like to do is that if the user enters a different amount into the .Discount field it will use the entered amount and override the if statement. Right now it is defaulting to the if statement. What would be the best way to achieve this.
If user inputs a value, it will be used. If the user leaves the field empty the if blocks will execute. Is that what you want?
Note that
(Discount) = ('.Discount').val();in your code probably should be(Discount) = $('.Discount').val();.Edit for the comments: