elclanrs 10 rokov pred
rodič
commit
c69c0f056b

+ 10 - 2
index.php

@@ -35,6 +35,14 @@
     font-size: 130%;
     font-weight: bold;
   }
+
+  .idealforms.adaptive #invalid {
+    margin-left: 0 !important;
+  }
+
+  .idealforms.adaptive .field.buttons label {
+    height: 0;
+  }
 </style>
 </head>
 <body>
@@ -129,7 +137,7 @@
 
             <div class="field buttons">
               <label class="main">&nbsp;</label>
-              <button type="button" class="next">&laquo; Previous</button>
+              <button type="button" class="prev">&laquo; Prev</button>
               <button type="button" class="next">Next &raquo;</button>
             </div>
 
@@ -171,7 +179,7 @@
 
             <div class="field buttons">
               <label class="main">&nbsp;</label>
-              <button type="button" class="next">&laquo; Previous</button>
+              <button type="button" class="prev">&laquo; Prev</button>
               <button type="submit" class="submit">Submit</button>
             </div>
 

+ 0 - 7
js/extensions/ajax/ajax.ext.js

@@ -55,13 +55,6 @@ module.exports = {
         $.idealforms._requests[input.name].abort();
         this._getField(input).removeClass('ajax');
       }
-    },
-
-    _validateAll: function(input) {
-      if ($(input).data('idealforms-ajax') && this._getField(input).data('idealforms-valid') === true) {
-        $.idealforms._requests[input.name].abort();
-        this._getField(input).removeClass('ajax');
-      }
     }
 
   }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 13 - 18
js/out/jquery.idealforms.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
js/out/jquery.idealforms.min.js


+ 13 - 11
js/private.js

@@ -13,16 +13,17 @@ module.exports = {
     this.$fields = $();
     this.$inputs = $();
 
+    this._inject('_init');
+
+    this.addRules(this.opts.rules || {});
+
     this.$form.submit(function(e) {
       e.preventDefault();
+      self._validateAll();
       self.focusFirstInvalid();
       self.opts.onSubmit.call(self, self.getInvalid().length, e);
     });
 
-    this._inject('_init');
-
-    this.addRules(this.opts.rules || {});
-
     if (! this.opts.silentLoad) this.focusFirstInvalid();
   },
 
@@ -55,14 +56,7 @@ module.exports = {
 
     $(input)
       .on('change keyup', function(e) {
-
-        var oldValue = $field.data('idealforms-value');
-
         if (e.which == 9 || e.which == 16) return;
-        if (! $(this).is(':checkbox, :radio') && oldValue == this.value) return;
-
-        $field.data('idealforms-value', this.value);
-
         self._validate(this, true, true);
       })
       .focus(function() {
@@ -125,9 +119,17 @@ module.exports = {
     var self = this
       , $field = this._getField(input)
       , userRules = this.opts.rules[input.name].split($.idealforms.ruleSeparator)
+      , oldValue = $field.data('idealforms-value')
       , valid = true
       , rule;
 
+    // Don't validate input if value hasn't changed
+    if (! $(input).is(':checkbox, :radio') && oldValue == input.value) {
+      return $field.data('idealforms-valid');
+    }
+
+    $field.data('idealforms-value', input.value);
+
     // Non-required input with empty value must pass validation
     if (! input.value && ! this._isRequired(input)) {
       $field.removeData('idealforms-valid');

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov