I have a series of rows with columns and I want to select the value of an input
field that is in a previous column to the input
field (price input)
var otherInput = $(this).closest('.row').find('.inputQty');
That goes up to a row level, then back down to .inputQty
.
You could try:
$(this).closest(".column").prev().find(".inputQty").val();
closest()
only looks for parents, I'm guessing what you really want is .find()
$(this).closest('.row').children('.column').find('.inputQty').val();
Get the .column
parent of the this
element, get its previous sibling, then find any input there:
$(this).closest(".column").prev().find("input:first").val();
Demo: http://jsfiddle.net/aWhtP/