I have this Input that is generating via Knockoutjs:
<input type="text" class="req" placeholder="" data-bind="value:Request" />
But I have to check if it is empty and if a specific css is applied: As many fields can be created the same, I can only apply my validation in the first field.
My JavaScript:
if ($(".req").val() == "") {
$(".req").addClass(validationClassErrosType.input)
}
validationCheckImage($("#req"), $("#req").parent());
The input image:
Well, he always takes the class first. how could I do this via javaScript?