You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have multiples forms wizard into popup and calling via javascript.
When I call the first popup, everything works very well.
When I call the first popup, close the popup and call again the same popup, the wizard not works.
This is my code in javascript to call the wizard.
$("#modalCMILivroRegisto_"+id).wizard('destroy');
$('#modalCMILivroRegisto_'+id+' .modal-dialog').html('');
$.ajax({
url: "/gestao/call/cmi/modal", // Url to which the request is send
type: "GET", // Type of request to be send, called as method
data: {id:id},
success: function(data) // A function to be called if request succeeds
{
$('#modalCMILivroRegisto_'+id+' .modal-dialog').html(data);
$('#modalCMILivroRegisto_'+id+' .modal-content#proprietario').select2({dropdownAutoWidth : true,width: 'auto'});
$(".data_inicio").datepicker({autoclose:true});
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
var switchery = new Switchery(html,{ color: 'rgb(30, 136, 229)'});
});
$(".inputmask_cmi").inputmask();
$('#modalCMILivroRegisto_'+id).modal("show");
validateCMI(id);
}
});
function validateCMI(id){
var defaults = $.components.getDefaults("wizard");
var options = $.extend(true, {}, defaults, {
onInit: function() {
$('#contratoFormUpdateCMI_'+id).formValidation({
framework: 'bootstrap',
fields: {
name: {
validators: {
notEmpty: {
message: 'Este campo é obrigatório!'
}
}
},
meses: {
validators: {
notEmpty: {
message: 'Este campo é obrigatório!'
}
}
},
inicio_contrato: {
validators: {
notEmpty: {
message: 'Este campo é obrigatório!'
}
}
},
cliente_id: {
validators: {
notEmpty: {
message: 'Este campo é obrigatório!'
}
}
}
}
});
},
validator: function() {
var fv = $('#contratoFormUpdateCMI_'+id).data('formValidation');
var $this = $(this);
Checklist
Description
Hello, I have multiples forms wizard into popup and calling via javascript.
When I call the first popup, everything works very well.
When I call the first popup, close the popup and call again the same popup, the wizard not works.
This is my code in javascript to call the wizard.
$("#modalCMILivroRegisto_"+id).wizard('destroy');
$('#modalCMILivroRegisto_'+id+' .modal-dialog').html('');
$.ajax({
url: "/gestao/call/cmi/modal", // Url to which the request is send
type: "GET", // Type of request to be send, called as method
data: {id:id},
success: function(data) // A function to be called if request succeeds
{
$('#modalCMILivroRegisto_'+id+' .modal-dialog').html(data);
$('#modalCMILivroRegisto_'+id+' .modal-content#proprietario').select2({dropdownAutoWidth : true,width: 'auto'});
$(".data_inicio").datepicker({autoclose:true});
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
var switchery = new Switchery(html,{ color: 'rgb(30, 136, 229)'});
});
$(".inputmask_cmi").inputmask();
$('#modalCMILivroRegisto_'+id).modal("show");
validateCMI(id);
}
});
function validateCMI(id){$this = $ (this);
var defaults = $.components.getDefaults("wizard");
var options = $.extend(true, {}, defaults, {
onInit: function() {
$('#contratoFormUpdateCMI_'+id).formValidation({
framework: 'bootstrap',
fields: {
name: {
validators: {
notEmpty: {
message: 'Este campo é obrigatório!'
}
}
},
meses: {
validators: {
notEmpty: {
message: 'Este campo é obrigatório!'
}
}
},
inicio_contrato: {
validators: {
notEmpty: {
message: 'Este campo é obrigatório!'
}
}
},
cliente_id: {
validators: {
notEmpty: {
message: 'Este campo é obrigatório!'
}
}
}
}
});
},
validator: function() {
var fv = $('#contratoFormUpdateCMI_'+id).data('formValidation');
var
}
The wizard can't be called twice or more. Only works the first time.
How can i fixed this to call everytime I need to call any popup?
The text was updated successfully, but these errors were encountered: