0
I got a registration chart in a modal, he’s got the save and cancel button, only by filling in all the required input and select it releases the save, and saved in the database, ta all working, only if I go in the change it brings all the options selected as it was saved, only comes the save button released only releases if pass the Focus in all mandatory fields. I would like it to release automatically since all required fields are saved.
this is javascript
jQuery(function() {
var $inputs = $(".inpSenha"), $button = $(".btnSalvar1");
var limpos = 0;
// verificação inicial
$inputs.each(function() {
var $this = $(this);
var val = $this.val();
val || limpos++;
$this.data("val-antigo", val);
});
$button.prop("disabled", !!limpos);
$inputs.on("change keyup mouseup", function() {
var $this = $(this);
var val = $this.val();
limpos += (val ? 0 : 1)
- ($this.data("val-antigo") ? 0 : 1);
$this.data("val-antigo", val);
$button.prop("disabled", !!limpos);
});
});
this is the Html of the save button
<button type="button" class="btn btn-default btnSalvar1" data-dismiss="modal" ng-click="salvarPessoas()">Salvar</button>
and inSenha and the class that goes in the input or select that will be required who can help me