.closest() finds the nearest parent element, .validation-error
is not a parent of the name-input
element. You need the .validation-error
element which comes under the same tr
as the input element
You need
$(this).closest('tr').find('.validation-error').show();
or
$(this).closest('td').next().find('.validation-error').show();