source: public/assets/js/examples/form-wizard.js@ 51b783f

develop
Last change on this file since 51b783f was 194a359, checked in by beratkjufliju <kufliju@…>, 3 years ago

added departments, edited users and added user settings

  • Property mode set to 100644
File size: 1.5 KB
Line 
1'use strict';
2$(document).ready(function () {
3
4 $('#wizard1').steps({
5 headerTag: 'h3',
6 bodyTag: 'section',
7 autoFocus: true,
8 titleTemplate: '<span class="wizard-index">#index#</span> #title#'
9 });
10
11 $('#wizard2').steps({
12 headerTag: 'h3',
13 bodyTag: 'section',
14 autoFocus: true,
15 titleTemplate: '<span class="wizard-index">#index#</span> #title#',
16 onStepChanging: function (event, currentIndex, newIndex) {
17 if (currentIndex < newIndex) {
18 var form = document.getElementById('form1'),
19 form2 = document.getElementById('form2');
20
21 if (currentIndex === 0) {
22 if (form.checkValidity() === false) {
23 event.preventDefault();
24 event.stopPropagation();
25 form.classList.add('was-validated');
26 } else {
27 return true;
28 }
29 } else if (currentIndex === 1) {
30 if (form2.checkValidity() === false) {
31 event.preventDefault();
32 event.stopPropagation();
33 form2.classList.add('was-validated');
34 } else {
35 return true;
36 }
37 } else {
38 return true;
39 }
40 } else {
41 return true;
42 }
43 }
44 });
45
46});
Note: See TracBrowser for help on using the repository browser.