It seems you want to do
if ($(this).val() == '')
instead of
if ($(this).val() == 0)
A valid alternative would be
if ($(this).val().length == 0)
Also, you should avoid returning true
always. Change your return value to this
return $('.input-error').length == 0