People I did a validation that when the user does not fill the input
my button is disabled more wanted to display a message to inform the user that the field should be filled it is possible to do this if yes they could help me follow my code
HTML:
<form id="form-morte">
<div class="form-group row">
<div class="col-sm-6 col-xs-6">
<input type="number" name="idade" class="form-control" id="idade"
min="1" max="10" step="2"
placeholder="Idade"/>
</div>
<div class="col-sm-6 col-xs-6">
<div class="input-group">
<span class="input-group-addon">R$</span>
<input type="phone" name="salario" class="form-control money-mask" id="salario"
placeholder="Salário atual"/>
</div>
</div>
</div>
<ul class="list-inline list-unstyled">
{{--<li><input type="submit" class="btn-back-morte" value="Voltar"></li>--}}
<li><a class="btn-back-morte">voltar</a></li>
<li><input type="submit" class="btn-next-morte" id="btn-next-morte" value="Próximo"></li>
{{--<li><a class="btn-back-morte">voltar</a></li>
<li><a class="btn-next-morte next-morte" disabled="disable" tabindex="-1">Próximo</a></li>--}}
</ul>
</form>
JS:
$('.btn-next-morte').attr('disabled',true);
$('input').keyup(function(){
if ($('#idade').val().length > 0 && $('#salario').val().length > 0){
$('.btn-next-morte').attr('disabled', false);
}
/*if($(this).val().length !=0){
$('.btn-next-morte').attr('disabled', false);
}*/
else
{
$('.btn-next-morte').attr('disabled', true);
}
});