You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.9 KiB
52 lines
1.9 KiB
$(".tab-wizard").steps({
|
|
headerTag: "h6"
|
|
, bodyTag: "section"
|
|
, transitionEffect: "fade"
|
|
, titleTemplate: '<span class="step">#index#</span> #title#'
|
|
, labels: {
|
|
finish: "Submit"
|
|
}
|
|
, onFinished: function (event, currentIndex) {
|
|
swal("Form Submitted!", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lorem erat eleifend ex semper, lobortis purus sed.");
|
|
}
|
|
});
|
|
|
|
|
|
var form = $(".validation-wizard").show();
|
|
|
|
$(".validation-wizard").steps({
|
|
headerTag: "h6"
|
|
, bodyTag: "section"
|
|
, transitionEffect: "fade"
|
|
, titleTemplate: '<span class="step">#index#</span> #title#'
|
|
, labels: {
|
|
finish: "Submit"
|
|
}
|
|
, onStepChanging: function (event, currentIndex, newIndex) {
|
|
return currentIndex > newIndex || !(3 === newIndex && Number($("#age-2").val()) < 18) && (currentIndex < newIndex && (form.find(".body:eq(" + newIndex + ") label.error").remove(), form.find(".body:eq(" + newIndex + ") .error").removeClass("error")), form.validate().settings.ignore = ":disabled,:hidden", form.valid())
|
|
}
|
|
, onFinishing: function (event, currentIndex) {
|
|
return form.validate().settings.ignore = ":disabled", form.valid()
|
|
}
|
|
, onFinished: function (event, currentIndex) {
|
|
swal("Form Submitted!", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lorem erat eleifend ex semper, lobortis purus sed.");
|
|
}
|
|
}), $(".validation-wizard").validate({
|
|
ignore: "input[type=hidden]"
|
|
, errorClass: "text-danger"
|
|
, successClass: "text-success"
|
|
, highlight: function (element, errorClass) {
|
|
$(element).removeClass(errorClass)
|
|
}
|
|
, unhighlight: function (element, errorClass) {
|
|
$(element).removeClass(errorClass)
|
|
}
|
|
, errorPlacement: function (error, element) {
|
|
error.insertAfter(element)
|
|
}
|
|
, rules: {
|
|
email: {
|
|
email: !0
|
|
}
|
|
}
|
|
}) |