I want to add a focusout function to this html array.
Array:
echo '<td><input name="codemf[]" type="text" id ="codemf'.$indexofid.'" class="form-control form-control-sm" required></td>';
Focusout function:
$('#codemf[]').focusout(function ()
{
if ($('#codemf[]').val() !== '')
{
$.get("req.php?mf=", function (data)
{
var is=0;
var info = data.split('|');
for(let i=0;i<info.length;++i)
{
if($('#codemf[]').val()==info[i])
{
is=1;
}
}
if(is==0)
{
$('#codemf[]').addClass("is-invalid");
$('#command').attr('disabled', true);
} else {
$('#codemf[]').removeClass("is-invalid");
$('#command').attr('disabled', false);
}
});
}
else
{
$('#codemf[]').removeClass("is-invalid");
$('#command').attr('disabled', false);
}
});
I tried a lot of things but nothing works... If anyone has an idea, it would save me.