From b4bf793e863f0226c472e8663d29b3e0358ea6be Mon Sep 17 00:00:00 2001 From: elclanrs Date: Tue, 10 Jun 2014 08:01:07 -0400 Subject: [PATCH] fix reset textarea & validateAll --- css/jquery.idealforms.css | 111 +------------------------------- js/out/jquery.idealforms.js | 10 +-- js/out/jquery.idealforms.min.js | 2 +- js/private.js | 6 +- js/public.js | 2 +- 5 files changed, 11 insertions(+), 120 deletions(-) diff --git a/css/jquery.idealforms.css b/css/jquery.idealforms.css index 3caa24c..caf3d43 100644 --- a/css/jquery.idealforms.css +++ b/css/jquery.idealforms.css @@ -4,113 +4,4 @@ * @version: 3.0 * @license GPL or MIT */ -.idealforms-field-width{width:619.3333333333334px} -form.idealforms{zoom:1;line-height:1.5;} -form.idealforms:before,form.idealforms:after{content:"";display:table} -form.idealforms:after{clear:both} -form.idealforms *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box} -form.idealforms .field{position:relative;float:left;clear:both;margin:.35em 0} -form.idealforms label.main,form.idealforms .field > input,form.idealforms select,form.idealforms button,form.idealforms textarea,form.idealforms .field .group{float:left} -form.idealforms label.main{width:120px;margin-top:.55em} -form.idealforms input,form.idealforms textarea,form.idealforms select,form.idealforms .field .group{margin:0;padding:0;border:0;outline:0;width:290px;padding:.55em;border:1px solid #999;outline:0;background:#fff;-webkit-border-radius:3.01px;border-radius:3.01px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.15)} -form.idealforms input{-webkit-transition:background 0.3s ease-in-out;-moz-transition:background 0.3s ease-in-out;-o-transition:background 0.3s ease-in-out;-ms-transition:background 0.3s ease-in-out;transition:background 0.3s ease-in-out} -form.idealforms textarea{width:435px} -form.idealforms select,form.idealforms button{color:#444;background:#eee;background:-webkit-linear-gradient(#fff, #ddd);background:-moz-linear-gradient(#fff, #ddd);background:-o-linear-gradient(#fff, #ddd);background:-ms-linear-gradient(#fff, #ddd);background:linear-gradient(#fff, #ddd);border:1px solid #aaa;border-bottom-color:#919191;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-border-radius:3.01px;border-radius:3.01px;padding:.55em 1.5em;cursor:pointer;} -form.idealforms select:hover,form.idealforms button:hover{background:-webkit-linear-gradient(#fff, #eaeaea);background:-moz-linear-gradient(#fff, #eaeaea);background:-o-linear-gradient(#fff, #eaeaea);background:-ms-linear-gradient(#fff, #eaeaea);background:linear-gradient(#fff, #eaeaea)} -form.idealforms select:active,form.idealforms button:active,form.idealforms select:active:focus,form.idealforms button:active:focus{color:#444;background:#eee;background:-webkit-linear-gradient(#fff, #ddd);background:-moz-linear-gradient(#fff, #ddd);background:-o-linear-gradient(#fff, #ddd);background:-ms-linear-gradient(#fff, #ddd);background:linear-gradient(#fff, #ddd);border:1px solid #aaa;border-bottom-color:#919191;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-border-radius:3.01px;border-radius:3.01px;background:#ddd} -form.idealforms select:focus,form.idealforms button:focus{outline:none;border-color:#3f9dcc;-webkit-box-shadow:0 0 1px #3f9dcc;box-shadow:0 0 1px #3f9dcc} -form.idealforms button{width:auto} -form.idealforms select{padding:.55em;} -form.idealforms select:focus{border:1px solid #444} -form.idealforms input[type="file"]{padding:0} -form.idealforms .field .group{position:relative;padding:1.25em;-webkit-box-shadow:none;box-shadow:none;} -form.idealforms .field .group label{float:left;clear:both;padding:.15em 0;} -form.idealforms .field .group input,form.idealforms .field .group label{margin:0} -form.idealforms .field .group input{width:auto;margin-right:.5em;-webkit-box-shadow:none;box-shadow:none} -form.idealforms .field .group label{margin-right:1em;} -form.idealforms .field .group label:last-of-type{margin:0} -form.idealforms .field.valid input,form.idealforms .field.valid select,form.idealforms .field.valid textarea,form.idealforms .field.valid .group{color:#18445a;background:#edf7fc;border-color:#3f9dcc} -form.idealforms .field.invalid input,form.idealforms .field.invalid select,form.idealforms .field.invalid textarea,form.idealforms .field.invalid .group{color:#430e08;background:#ffeded;border-color:#cc2a18} -form.idealforms .field.valid .group,form.idealforms .field.invalid .group,form.idealforms .field.valid textarea,form.idealforms .field.invalid textarea,form.idealforms .field.valid select,form.idealforms .field.invalid select{color:inherit;background:none} -form.idealforms .field.valid select,form.idealforms .field.invalid select{background:-webkit-linear-gradient(#fff, #ddd);background:-moz-linear-gradient(#fff, #ddd);background:-o-linear-gradient(#fff, #ddd);background:-ms-linear-gradient(#fff, #ddd);background:linear-gradient(#fff, #ddd)} -form.idealforms .field .icon{position:absolute;width:16px;height:16px;top:50%;left:100%;margin-top:-8px;margin-left:8px;background:url("../img/validation.png") -16px 0 no-repeat;cursor:pointer} -form.idealforms .field.invalid .icon{background-position:-16px 0} -form.idealforms .field.valid .icon{background-position:0 0;cursor:default} -form.idealforms .field.invalid .group input,form.idealforms .field.valid .group input{border:0;outline:0;-webkit-box-shadow:none;box-shadow:none} -form.idealforms .field.ajax input{color:#463a09;background:#faf9e8;border-color:#cfaa19} -form.idealforms .field.ajax .icon{background:url("../img/loading.gif")} -form.idealforms .error{display:none;position:absolute;z-index:1;left:100%;top:50%;padding:1em 1.5em;width:193.33333333333334px;margin-left:40px;background:#285d85;background:-webkit-linear-gradient(#285d85, #3070a0);background:-moz-linear-gradient(#285d85, #3070a0);background:-o-linear-gradient(#285d85, #3070a0);background:-ms-linear-gradient(#285d85, #3070a0);background:linear-gradient(#285d85, #3070a0);color:#fff;font-size:85%;font-weight:bold;text-shadow:0 1px 0 rgba(0,0,0,0.3);line-height:1.35;border:1px solid #1c425e;-webkit-border-radius:0 3.01px 3.01px 3.01px;border-radius:0 3.01px 3.01px 3.01px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.15);box-shadow:0 1px 1px rgba(0,0,0,0.15);} -form.idealforms .error:after{content:"";position:absolute;z-index:-1;top:-1px;left:-.7em;border-width:.7em;border-style:solid;border-color:transparent;border-top-color:#285d85} -form.idealforms .idealforms-field-checkbox .icon,form.idealforms .idealforms-field-radio .icon,form.idealforms .idealforms-field-textarea .icon{top:8px;margin-top:0} -form.idealforms .idealforms-field-checkbox .error,form.idealforms .idealforms-field-radio .error,form.idealforms .idealforms-field-textarea .error{top:1.25em} -form.idealforms.adaptive .field{float:none;max-width:290px;zoom:1} -form.idealforms.adaptive .field:before,form.idealforms.adaptive .field:after{content:"";display:table} -form.idealforms.adaptive .field:after{clear:both} -form.idealforms.adaptive label.main{display:block;float:none;width:auto;padding-bottom:.5em} -form.idealforms.adaptive input,form.idealforms.adaptive textarea,form.idealforms.adaptive select,form.idealforms.adaptive .field .group{width:100%} -form.idealforms.adaptive .field .icon{top:0;margin-top:3.2em} -form.idealforms.adaptive .error{position:relative;float:left;clear:both;width:100%;left:0;margin-left:0;margin-top:3px;-webkit-border-radius:3.01px;border-radius:3.01px;} -form.idealforms.adaptive .error:after{top:2px;left:50%;margin-top:-1.4em;margin-left:-.35em;border-color:transparent;border-bottom-color:#285d85} -form.idealforms.adaptive .error.hidden{position:absolute;visibility:hidden} -form.idealforms.adaptive .idealforms-field-checkbox .error,form.idealforms.adaptive .idealforms-field-radio .error,form.idealforms.adaptive .idealforms-field-textarea .error{top:0} -.idealsteps-container *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box} -.idealsteps-step{display:none;zoom:1} -.idealsteps-step:before,.idealsteps-step:after{content:"";display:table} -.idealsteps-step:after{clear:both} -.idealsteps-nav{color:#444;background:#eee;background:-webkit-linear-gradient(#fff, #ddd);background:-moz-linear-gradient(#fff, #ddd);background:-o-linear-gradient(#fff, #ddd);background:-ms-linear-gradient(#fff, #ddd);background:linear-gradient(#fff, #ddd);border:1px solid #aaa;border-bottom-color:#919191;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-border-radius:3.01px;border-radius:3.01px;overflow:hidden;margin-bottom:2em;} -.idealsteps-nav ul{margin:0;padding:0;border:0;outline:0;list-style:none} -.idealsteps-nav li{float:left} -.idealsteps-nav a{position:relative;float:left;padding:0 1.5em 0 2.75em;height:3.5em;line-height:3.5em;text-decoration:none;color:#5e5e5e;background:#ddd;-webkit-transition:padding 0.2s ease-in-out;-moz-transition:padding 0.2s ease-in-out;-o-transition:padding 0.2s ease-in-out;-ms-transition:padding 0.2s ease-in-out;transition:padding 0.2s ease-in-out;} -.idealsteps-nav a:focus{outline:0} -.idealsteps-nav a:hover{background:#eaeaea;} -.idealsteps-nav a:hover:after{border-left-color:#eaeaea} -.idealsteps-nav a:after,.idealsteps-nav a:before{content:"";position:absolute;z-index:1;top:0;right:-2em;margin-right:0;margin-top:-.125em;border-width:2em 1em;border-style:solid;border-color:transparent;border-left-color:#ddd} -.idealsteps-nav a:before{margin-right:-1px;border-left-color:#aaa} -.idealsteps-nav li:first-child a{padding-left:1.75em;-webkit-border-top-left-radius:3.01px;border-top-left-radius:3.01px;-webkit-border-bottom-left-radius:3.01px;border-bottom-left-radius:3.01px;} -.idealsteps-nav li.idealsteps-step-active a{padding-right:3.5em;background:#fff;color:#3f9dcc;font-weight:bold;cursor:default;} -.idealsteps-nav li.idealsteps-step-active a:after{border-left-color:#fff} -.idealsteps-nav li.idealsteps-step-active .counter{opacity:1;-ms-filter:none;filter:none} -.idealsteps-nav .counter{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);position:absolute;top:50%;right:1em;height:1.5em;width:1.5em;margin-top:-.75em;line-height:1.5 !important;text-align:center;color:#cc2a18;border:1px solid #cc2a18;-webkit-border-radius:10em;border-radius:10em;-webkit-transition:opacity 0.2s ease-in-out;-moz-transition:opacity 0.2s ease-in-out;-o-transition:opacity 0.2s ease-in-out;-ms-transition:opacity 0.2s ease-in-out;transition:opacity 0.2s ease-in-out;} -.idealsteps-nav .counter.zero{color:#3f9dcc;border-color:#3f9dcc} -.idealsteps-container.adaptive .idealsteps-nav{max-width:290px;border-bottom:0;} -.idealsteps-container.adaptive .idealsteps-nav li{float:none;overflow:hidden} -.idealsteps-container.adaptive .idealsteps-nav a,.idealsteps-container.adaptive .idealsteps-nav li:first-child a,.idealsteps-container.adaptive .idealsteps-nav li.idealsteps-step-active a{width:100%;padding:0 2.5em 0 1.5em;border-bottom:1px solid #aaa;border-top:1px solid #f7f7f7;-webkit-border-radius:0;border-radius:0;} -.idealsteps-container.adaptive .idealsteps-nav a:after,.idealsteps-container.adaptive .idealsteps-nav li:first-child a:after,.idealsteps-container.adaptive .idealsteps-nav li.idealsteps-step-active a:after,.idealsteps-container.adaptive .idealsteps-nav a:before,.idealsteps-container.adaptive .idealsteps-nav li:first-child a:before,.idealsteps-container.adaptive .idealsteps-nav li.idealsteps-step-active a:before{display:none} -.idealsteps-container.adaptive .idealsteps-nav li:first-child a{-webkit-border-top-left-radius:3.01px;border-top-left-radius:3.01px;-webkit-border-top-right-radius:3.01px;border-top-right-radius:3.01px;} -.idealsteps-container.adaptive .idealsteps-nav li:last-child a{-webkit-border-bottom-left-radius:3.01px;border-bottom-left-radius:3.01px;-webkit-border-bottom-right-radius:3.01px;border-bottom-right-radius:3.01px;} -.idealsteps-container.adaptive .idealsteps-nav li.idealsteps-step-active a{padding-right:1.5em} -.idealsteps-container.adaptive .idealsteps-nav .counter{position:relative;float:right;right:0} -form.idealforms .ideal-radiocheck-label{display:inline-block;padding:.25em 0 !important;cursor:pointer;} -form.idealforms .ideal-radiocheck-label input{float:left} -form.idealforms .ideal-check,form.idealforms .ideal-radio{float:left;margin-right:10px !important;width:20px;height:20px;background:url("../img/radiocheck.png") 0 0} -form.idealforms .ideal-check.focus{background-position:-20px 0} -form.idealforms .ideal-check.checked{background-position:-40px 0} -form.idealforms .ideal-check.checked.focus{background-position:-60px 0} -form.idealforms .ideal-radio{background-position:0 bottom} -form.idealforms .ideal-radio.focus{background-position:-20px bottom} -form.idealforms .ideal-radio.checked{background-position:-40px bottom} -form.idealforms .ideal-radio.checked.focus{background-position:-60px bottom} -form.idealforms .ideal-file-wrap{float:left} -form.idealforms .ideal-file-filename{float:left;width:204px;height:100%;-webkit-border-radius:0;border-radius:0;-webkit-border-top-left-radius:3.01px;border-top-left-radius:3.01px;-webkit-border-bottom-left-radius:3.01px;border-bottom-left-radius:3.01px;} -form.idealforms .ideal-file-upload{color:#444;background:#eee;background:-webkit-linear-gradient(#fff, #ddd);background:-moz-linear-gradient(#fff, #ddd);background:-o-linear-gradient(#fff, #ddd);background:-ms-linear-gradient(#fff, #ddd);background:linear-gradient(#fff, #ddd);border:1px solid #aaa;border-bottom-color:#919191;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-border-radius:3.01px;border-radius:3.01px;padding:.55em 1.5em;cursor:pointer;overflow:visible;position:relative;float:right;left:-1px;width:87px;padding-left:0;padding-right:0;text-align:center;-webkit-border-radius:0;border-radius:0;-webkit-border-top-right-radius:3.01px;border-top-right-radius:3.01px;-webkit-border-bottom-right-radius:3.01px;border-bottom-right-radius:3.01px;} -form.idealforms .ideal-file-upload:hover{background:-webkit-linear-gradient(#fff, #eaeaea);background:-moz-linear-gradient(#fff, #eaeaea);background:-o-linear-gradient(#fff, #eaeaea);background:-ms-linear-gradient(#fff, #eaeaea);background:linear-gradient(#fff, #eaeaea)} -form.idealforms .ideal-file-upload:active,form.idealforms .ideal-file-upload:active:focus{color:#444;background:#eee;background:-webkit-linear-gradient(#fff, #ddd);background:-moz-linear-gradient(#fff, #ddd);background:-o-linear-gradient(#fff, #ddd);background:-ms-linear-gradient(#fff, #ddd);background:linear-gradient(#fff, #ddd);border:1px solid #aaa;border-bottom-color:#919191;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-border-radius:3.01px;border-radius:3.01px;background:#ddd} -form.idealforms .ideal-file-upload:focus{outline:none;border-color:#3f9dcc;-webkit-box-shadow:0 0 1px #3f9dcc;box-shadow:0 0 1px #3f9dcc} -form.idealforms.adaptive .ideal-file-wrap{width:100%} -form.idealforms.adaptive .ideal-file-filename{width:70%} -form.idealforms.adaptive .ideal-file-upload{width:30%} -.ideal-file-upload.ie{line-height:1.15} -.idealforms input.datepicker.open{border-bottom-color:transparent;-webkit-border-radius:0;border-radius:0;-webkit-border-top-left-radius:3.01px;border-top-left-radius:3.01px;-webkit-border-top-right-radius:3.01px;border-top-right-radius:3.01px;} -.ui-datepicker{display:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:290px;margin-top:-2px;padding:.75em;background:#fff;border:1px solid #999;-webkit-border-bottom-left-radius:3.01px;border-bottom-left-radius:3.01px;-webkit-border-bottom-right-radius:3.01px;border-bottom-right-radius:3.01px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.2);box-shadow:0 1px 2px rgba(0,0,0,0.2)} -.ui-datepicker-header{position:relative;padding:.2em 0;margin-bottom:.75em;font-weight:bold;} -.ui-datepicker-header .ui-datepicker-title{text-align:center} -.ui-datepicker-header .ui-datepicker-prev,.ui-datepicker-header .ui-datepicker-next{text-indent:-9999px;width:16px;height:16px;position:absolute;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:url("../img/datepicker.png") 0 0;} -.ui-datepicker-header .ui-datepicker-prev:active,.ui-datepicker-header .ui-datepicker-next:active{margin-top:1px} -.ui-datepicker-header .ui-datepicker-next{background-position:-16px 0} -.ui-datepicker-header .ui-datepicker-prev{left:8px} -.ui-datepicker-header .ui-datepicker-next{right:8px} -.ui-datepicker-calendar{width:100%;border-collapse:collapse;table-layout:fixed;} -.ui-datepicker-calendar td{padding:.25em 0;text-align:center} -.ui-datepicker-calendar a{display:block;text-decoration:none;color:#808080;} -.ui-datepicker-calendar a:hover{color:#3f9dcc;font-weight:bold} -.ui-datepicker-calendar .ui-datepicker-today a{margin:0 .25em;background:#eee;-webkit-border-radius:3.01px;border-radius:3.01px} +.idealforms-field-width{width:619.3333333333334px}form.idealforms{zoom:1;line-height:1.5;}form.idealforms:before,form.idealforms:after{content:"";display:table}form.idealforms:after{clear:both}form.idealforms *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}form.idealforms .field{position:relative;float:left;clear:both;margin:.35em 0}form.idealforms label.main,form.idealforms .field > input,form.idealforms select,form.idealforms button,form.idealforms textarea,form.idealforms .field .group{float:left}form.idealforms label.main{width:120px;margin-top:.55em}form.idealforms input,form.idealforms textarea,form.idealforms select,form.idealforms .field .group{margin:0;padding:0;border:0;outline:0;width:290px;padding:.55em;border:1px solid #999;outline:0;background:#fff;-webkit-border-radius:3.01px;border-radius:3.01px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.15)}form.idealforms input{-webkit-transition:background 0.3s ease-in-out;-moz-transition:background 0.3s ease-in-out;-o-transition:background 0.3s ease-in-out;-ms-transition:background 0.3s ease-in-out;transition:background 0.3s ease-in-out}form.idealforms textarea{width:435px}form.idealforms select,form.idealforms button{color:#444;background:#eee;background:-webkit-linear-gradient(#fff, #ddd);background:-moz-linear-gradient(#fff, #ddd);background:-o-linear-gradient(#fff, #ddd);background:-ms-linear-gradient(#fff, #ddd);background:linear-gradient(#fff, #ddd);border:1px solid #aaa;border-bottom-color:#919191;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-border-radius:3.01px;border-radius:3.01px;padding:.55em 1.5em;cursor:pointer;}form.idealforms select:hover,form.idealforms button:hover{background:-webkit-linear-gradient(#fff, #eaeaea);background:-moz-linear-gradient(#fff, #eaeaea);background:-o-linear-gradient(#fff, #eaeaea);background:-ms-linear-gradient(#fff, #eaeaea);background:linear-gradient(#fff, #eaeaea)}form.idealforms select:active,form.idealforms button:active,form.idealforms select:active:focus,form.idealforms button:active:focus{color:#444;background:#eee;background:-webkit-linear-gradient(#fff, #ddd);background:-moz-linear-gradient(#fff, #ddd);background:-o-linear-gradient(#fff, #ddd);background:-ms-linear-gradient(#fff, #ddd);background:linear-gradient(#fff, #ddd);border:1px solid #aaa;border-bottom-color:#919191;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-border-radius:3.01px;border-radius:3.01px;background:#ddd}form.idealforms select:focus,form.idealforms button:focus{outline:none;border-color:#3f9dcc;-webkit-box-shadow:0 0 1px #3f9dcc;box-shadow:0 0 1px #3f9dcc}form.idealforms button{width:auto}form.idealforms select{padding:.55em;}form.idealforms select:focus{border:1px solid #444}form.idealforms input[type="file"]{padding:0}form.idealforms .field .group{position:relative;padding:1.25em;-webkit-box-shadow:none;box-shadow:none;}form.idealforms .field .group label{float:left;clear:both;padding:.15em 0;}form.idealforms .field .group input,form.idealforms .field .group label{margin:0}form.idealforms .field .group input{width:auto;margin-right:.5em;-webkit-box-shadow:none;box-shadow:none}form.idealforms .field .group label{margin-right:1em;}form.idealforms .field .group label:last-of-type{margin:0}form.idealforms .field.valid input,form.idealforms .field.valid select,form.idealforms .field.valid textarea,form.idealforms .field.valid .group{color:#18445a;background:#edf7fc;border-color:#3f9dcc}form.idealforms .field.invalid input,form.idealforms .field.invalid select,form.idealforms .field.invalid textarea,form.idealforms .field.invalid .group{color:#430e08;background:#ffeded;border-color:#cc2a18}form.idealforms .field.valid .group,form.idealforms .field.invalid .group,form.idealforms .field.valid textarea,form.idealforms .field.invalid textarea,form.idealforms .field.valid select,form.idealforms .field.invalid select{color:inherit;background:none}form.idealforms .field.valid select,form.idealforms .field.invalid select{background:-webkit-linear-gradient(#fff, #ddd);background:-moz-linear-gradient(#fff, #ddd);background:-o-linear-gradient(#fff, #ddd);background:-ms-linear-gradient(#fff, #ddd);background:linear-gradient(#fff, #ddd)}form.idealforms .field .icon{position:absolute;width:16px;height:16px;top:50%;left:100%;margin-top:-8px;margin-left:8px;background:url("../img/validation.png") -16px 0 no-repeat;cursor:pointer}form.idealforms .field.invalid .icon{background-position:-16px 0}form.idealforms .field.valid .icon{background-position:0 0;cursor:default}form.idealforms .field.invalid .group input,form.idealforms .field.valid .group input{border:0;outline:0;-webkit-box-shadow:none;box-shadow:none}form.idealforms .field.ajax input{color:#463a09;background:#faf9e8;border-color:#cfaa19}form.idealforms .field.ajax .icon{background:url("../img/loading.gif")}form.idealforms .error{display:none;position:absolute;z-index:1;left:100%;top:50%;padding:1em 1.5em;width:193.33333333333334px;margin-left:40px;background:#285d85;background:-webkit-linear-gradient(#285d85, #3070a0);background:-moz-linear-gradient(#285d85, #3070a0);background:-o-linear-gradient(#285d85, #3070a0);background:-ms-linear-gradient(#285d85, #3070a0);background:linear-gradient(#285d85, #3070a0);color:#fff;font-size:85%;font-weight:bold;text-shadow:0 1px 0 rgba(0,0,0,0.3);line-height:1.35;border:1px solid #1c425e;-webkit-border-radius:0 3.01px 3.01px 3.01px;border-radius:0 3.01px 3.01px 3.01px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.15);box-shadow:0 1px 1px rgba(0,0,0,0.15);}form.idealforms .error:after{content:"";position:absolute;z-index:-1;top:-1px;left:-.7em;border-width:.7em;border-style:solid;border-color:transparent;border-top-color:#285d85}form.idealforms .idealforms-field-checkbox .icon,form.idealforms .idealforms-field-radio .icon,form.idealforms .idealforms-field-textarea .icon{top:8px;margin-top:0}form.idealforms .idealforms-field-checkbox .error,form.idealforms .idealforms-field-radio .error,form.idealforms .idealforms-field-textarea .error{top:1.25em}form.idealforms.adaptive .field{float:none;max-width:290px;zoom:1}form.idealforms.adaptive .field:before,form.idealforms.adaptive .field:after{content:"";display:table}form.idealforms.adaptive .field:after{clear:both}form.idealforms.adaptive label.main{display:block;float:none;width:auto;padding-bottom:.5em}form.idealforms.adaptive input,form.idealforms.adaptive textarea,form.idealforms.adaptive select,form.idealforms.adaptive .field .group{width:100%}form.idealforms.adaptive .field .icon{top:0;margin-top:3.2em}form.idealforms.adaptive .error{position:relative;float:left;clear:both;width:100%;left:0;margin-left:0;margin-top:3px;-webkit-border-radius:3.01px;border-radius:3.01px;}form.idealforms.adaptive .error:after{top:2px;left:50%;margin-top:-1.4em;margin-left:-.35em;border-color:transparent;border-bottom-color:#285d85}form.idealforms.adaptive .error.hidden{position:absolute;visibility:hidden}form.idealforms.adaptive .idealforms-field-checkbox .error,form.idealforms.adaptive .idealforms-field-radio .error,form.idealforms.adaptive .idealforms-field-textarea .error{top:0}.idealsteps-container *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.idealsteps-step{display:none;zoom:1}.idealsteps-step:before,.idealsteps-step:after{content:"";display:table}.idealsteps-step:after{clear:both}.idealsteps-nav{color:#444;background:#eee;background:-webkit-linear-gradient(#fff, #ddd);background:-moz-linear-gradient(#fff, #ddd);background:-o-linear-gradient(#fff, #ddd);background:-ms-linear-gradient(#fff, #ddd);background:linear-gradient(#fff, #ddd);border:1px solid #aaa;border-bottom-color:#919191;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-border-radius:3.01px;border-radius:3.01px;overflow:hidden;margin-bottom:2em;}.idealsteps-nav ul{margin:0;padding:0;border:0;outline:0;list-style:none}.idealsteps-nav li{float:left}.idealsteps-nav a{position:relative;float:left;padding:0 1.5em 0 2.75em;height:3.5em;line-height:3.5em;text-decoration:none;color:#5e5e5e;background:#ddd;-webkit-transition:padding 0.2s ease-in-out;-moz-transition:padding 0.2s ease-in-out;-o-transition:padding 0.2s ease-in-out;-ms-transition:padding 0.2s ease-in-out;transition:padding 0.2s ease-in-out;}.idealsteps-nav a:focus{outline:0}.idealsteps-nav a:hover{background:#eaeaea;}.idealsteps-nav a:hover:after{border-left-color:#eaeaea}.idealsteps-nav a:after,.idealsteps-nav a:before{content:"";position:absolute;z-index:1;top:0;right:-2em;margin-right:0;margin-top:-.125em;border-width:2em 1em;border-style:solid;border-color:transparent;border-left-color:#ddd}.idealsteps-nav a:before{margin-right:-1px;border-left-color:#aaa}.idealsteps-nav li:first-child a{padding-left:1.75em;-webkit-border-top-left-radius:3.01px;border-top-left-radius:3.01px;-webkit-border-bottom-left-radius:3.01px;border-bottom-left-radius:3.01px;}.idealsteps-nav li.idealsteps-step-active a{padding-right:3.5em;background:#fff;color:#3f9dcc;font-weight:bold;cursor:default;}.idealsteps-nav li.idealsteps-step-active a:after{border-left-color:#fff}.idealsteps-nav li.idealsteps-step-active .counter{opacity:1;-ms-filter:none;filter:none}.idealsteps-nav .counter{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);position:absolute;top:50%;right:1em;height:1.5em;width:1.5em;margin-top:-.75em;line-height:1.5 !important;text-align:center;color:#cc2a18;border:1px solid #cc2a18;-webkit-border-radius:10em;border-radius:10em;-webkit-transition:opacity 0.2s ease-in-out;-moz-transition:opacity 0.2s ease-in-out;-o-transition:opacity 0.2s ease-in-out;-ms-transition:opacity 0.2s ease-in-out;transition:opacity 0.2s ease-in-out;}.idealsteps-nav .counter.zero{color:#3f9dcc;border-color:#3f9dcc}.idealsteps-container.adaptive .idealsteps-nav{max-width:290px;border-bottom:0;}.idealsteps-container.adaptive .idealsteps-nav li{float:none;overflow:hidden}.idealsteps-container.adaptive .idealsteps-nav a,.idealsteps-container.adaptive .idealsteps-nav li:first-child a,.idealsteps-container.adaptive .idealsteps-nav li.idealsteps-step-active a{width:100%;padding:0 2.5em 0 1.5em;border-bottom:1px solid #aaa;border-top:1px solid #f7f7f7;-webkit-border-radius:0;border-radius:0;}.idealsteps-container.adaptive .idealsteps-nav a:after,.idealsteps-container.adaptive .idealsteps-nav li:first-child a:after,.idealsteps-container.adaptive .idealsteps-nav li.idealsteps-step-active a:after,.idealsteps-container.adaptive .idealsteps-nav a:before,.idealsteps-container.adaptive .idealsteps-nav li:first-child a:before,.idealsteps-container.adaptive .idealsteps-nav li.idealsteps-step-active a:before{display:none}.idealsteps-container.adaptive .idealsteps-nav li:first-child a{-webkit-border-top-left-radius:3.01px;border-top-left-radius:3.01px;-webkit-border-top-right-radius:3.01px;border-top-right-radius:3.01px;}.idealsteps-container.adaptive .idealsteps-nav li:last-child a{-webkit-border-bottom-left-radius:3.01px;border-bottom-left-radius:3.01px;-webkit-border-bottom-right-radius:3.01px;border-bottom-right-radius:3.01px;}.idealsteps-container.adaptive .idealsteps-nav li.idealsteps-step-active a{padding-right:1.5em}.idealsteps-container.adaptive .idealsteps-nav .counter{position:relative;float:right;right:0}form.idealforms .ideal-radiocheck-label{display:inline-block;padding:.25em 0 !important;cursor:pointer;}form.idealforms .ideal-radiocheck-label input{float:left}form.idealforms .ideal-check,form.idealforms .ideal-radio{float:left;margin-right:10px !important;width:20px;height:20px;background:url("../img/radiocheck.png") 0 0}form.idealforms .ideal-check.focus{background-position:-20px 0}form.idealforms .ideal-check.checked{background-position:-40px 0}form.idealforms .ideal-check.checked.focus{background-position:-60px 0}form.idealforms .ideal-radio{background-position:0 bottom}form.idealforms .ideal-radio.focus{background-position:-20px bottom}form.idealforms .ideal-radio.checked{background-position:-40px bottom}form.idealforms .ideal-radio.checked.focus{background-position:-60px bottom}form.idealforms .ideal-file-wrap{float:left}form.idealforms .ideal-file-filename{float:left;width:204px;height:100%;-webkit-border-radius:0;border-radius:0;-webkit-border-top-left-radius:3.01px;border-top-left-radius:3.01px;-webkit-border-bottom-left-radius:3.01px;border-bottom-left-radius:3.01px;}form.idealforms .ideal-file-upload{color:#444;background:#eee;background:-webkit-linear-gradient(#fff, #ddd);background:-moz-linear-gradient(#fff, #ddd);background:-o-linear-gradient(#fff, #ddd);background:-ms-linear-gradient(#fff, #ddd);background:linear-gradient(#fff, #ddd);border:1px solid #aaa;border-bottom-color:#919191;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-border-radius:3.01px;border-radius:3.01px;padding:.55em 1.5em;cursor:pointer;overflow:visible;position:relative;float:right;left:-1px;width:87px;padding-left:0;padding-right:0;text-align:center;-webkit-border-radius:0;border-radius:0;-webkit-border-top-right-radius:3.01px;border-top-right-radius:3.01px;-webkit-border-bottom-right-radius:3.01px;border-bottom-right-radius:3.01px;}form.idealforms .ideal-file-upload:hover{background:-webkit-linear-gradient(#fff, #eaeaea);background:-moz-linear-gradient(#fff, #eaeaea);background:-o-linear-gradient(#fff, #eaeaea);background:-ms-linear-gradient(#fff, #eaeaea);background:linear-gradient(#fff, #eaeaea)}form.idealforms .ideal-file-upload:active,form.idealforms .ideal-file-upload:active:focus{color:#444;background:#eee;background:-webkit-linear-gradient(#fff, #ddd);background:-moz-linear-gradient(#fff, #ddd);background:-o-linear-gradient(#fff, #ddd);background:-ms-linear-gradient(#fff, #ddd);background:linear-gradient(#fff, #ddd);border:1px solid #aaa;border-bottom-color:#919191;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-border-radius:3.01px;border-radius:3.01px;background:#ddd}form.idealforms .ideal-file-upload:focus{outline:none;border-color:#3f9dcc;-webkit-box-shadow:0 0 1px #3f9dcc;box-shadow:0 0 1px #3f9dcc}form.idealforms.adaptive .ideal-file-wrap{width:100%}form.idealforms.adaptive .ideal-file-filename{width:70%}form.idealforms.adaptive .ideal-file-upload{width:30%}.ideal-file-upload.ie{line-height:1.15}.idealforms input.datepicker.open{border-bottom-color:transparent;-webkit-border-radius:0;border-radius:0;-webkit-border-top-left-radius:3.01px;border-top-left-radius:3.01px;-webkit-border-top-right-radius:3.01px;border-top-right-radius:3.01px;}.ui-datepicker{display:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:290px;margin-top:-2px;padding:.75em;background:#fff;border:1px solid #999;-webkit-border-bottom-left-radius:3.01px;border-bottom-left-radius:3.01px;-webkit-border-bottom-right-radius:3.01px;border-bottom-right-radius:3.01px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.2);box-shadow:0 1px 2px rgba(0,0,0,0.2)}.ui-datepicker-header{position:relative;padding:.2em 0;margin-bottom:.75em;font-weight:bold;}.ui-datepicker-header .ui-datepicker-title{text-align:center}.ui-datepicker-header .ui-datepicker-prev,.ui-datepicker-header .ui-datepicker-next{text-indent:-9999px;width:16px;height:16px;position:absolute;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:url("../img/datepicker.png") 0 0;}.ui-datepicker-header .ui-datepicker-prev:active,.ui-datepicker-header .ui-datepicker-next:active{margin-top:1px}.ui-datepicker-header .ui-datepicker-next{background-position:-16px 0}.ui-datepicker-header .ui-datepicker-prev{left:8px}.ui-datepicker-header .ui-datepicker-next{right:8px}.ui-datepicker-calendar{width:100%;border-collapse:collapse;table-layout:fixed;}.ui-datepicker-calendar td{padding:.25em 0;text-align:center}.ui-datepicker-calendar a{display:block;text-decoration:none;color:#808080;}.ui-datepicker-calendar a:hover{color:#3f9dcc;font-weight:bold}.ui-datepicker-calendar .ui-datepicker-today a{margin:0 .25em;background:#eee;-webkit-border-radius:3.01px;border-radius:3.01px} \ No newline at end of file diff --git a/js/out/jquery.idealforms.js b/js/out/jquery.idealforms.js index 54cff63..f71f2b3 100644 --- a/js/out/jquery.idealforms.js +++ b/js/out/jquery.idealforms.js @@ -1001,7 +1001,7 @@ module.exports = { this.addRules(this.opts.rules || {}); this.$form.submit(function(e) { - self._validateAll(); + self._validateAll(true); self.focusFirstInvalid(); self.opts.onSubmit.call(self, self.getInvalid().length, e); }); @@ -1185,9 +1185,9 @@ module.exports = { return valid; }, - _validateAll: function() { + _validateAll: function(handleStyle, handleError) { var self = this; - this.$inputs.each(function(){ self._validate(this, true); }); + this.$inputs.each(function(){ self._validate(this, handleStyle, handleError); }); } }; @@ -1246,7 +1246,7 @@ module.exports = { if (name) $inputs = $inputs.filter('[name="'+ name +'"]'); - $inputs.filter('input:not(:checkbox, :radio)').val(''); + $inputs.filter('input:not(:checkbox, :radio), textarea').val(''); $inputs.filter(':checkbox, :radio').prop('checked', false); $inputs.filter('select').find('option').prop('selected', function() { return this.defaultSelected; @@ -1365,4 +1365,4 @@ module.exports = { }; },{}]},{},[11]) -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJhdGVkLmpzIiwic291cmNlcyI6WyIvdXNyL2xpYi9ub2RlX21vZHVsZXMvYnJvd3NlcmlmeS9ub2RlX21vZHVsZXMvYnJvd3Nlci1wYWNrL19wcmVsdWRlLmpzIiwiL3Zhci93d3cvanEtaWRlYWxmb3Jtcy9qcy9lcnJvcnMuanMiLCIvdmFyL3d3dy9qcS1pZGVhbGZvcm1zL2pzL2V4dGVuc2lvbnMvYWRhcHRpdmUvYWRhcHRpdmUuZXh0LmpzIiwiL3Zhci93d3cvanEtaWRlYWxmb3Jtcy9qcy9leHRlbnNpb25zL2FqYXgvYWpheC5leHQuanMiLCIvdmFyL3d3dy9qcS1pZGVhbGZvcm1zL2pzL2V4dGVuc2lvbnMvY3VzdG9tLWlucHV0cy9jdXN0b20taW5wdXRzLmV4dC5qcyIsIi92YXIvd3d3L2pxLWlkZWFsZm9ybXMvanMvZXh0ZW5zaW9ucy9jdXN0b20taW5wdXRzL2lkZWFsZmlsZS5qcyIsIi92YXIvd3d3L2pxLWlkZWFsZm9ybXMvanMvZXh0ZW5zaW9ucy9jdXN0b20taW5wdXRzL2lkZWFscmFkaW9jaGVjay5qcyIsIi92YXIvd3d3L2pxLWlkZWFsZm9ybXMvanMvZXh0ZW5zaW9ucy9kYXRlcGlja2VyL2RhdGVwaWNrZXIuZXh0LmpzIiwiL3Zhci93d3cvanEtaWRlYWxmb3Jtcy9qcy9leHRlbnNpb25zL2R5bmFtaWMtZmllbGRzL2R5bmFtaWMtZmllbGRzLmV4dC5qcyIsIi92YXIvd3d3L2pxLWlkZWFsZm9ybXMvanMvZXh0ZW5zaW9ucy9zdGVwcy9pZGVhbHN0ZXBzLmpzIiwiL3Zhci93d3cvanEtaWRlYWxmb3Jtcy9qcy9leHRlbnNpb25zL3N0ZXBzL3N0Z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GZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAvLyBIYWNrIHRvIGZpeCBJRTkgbm90IHJlc2l6aW5nXG4gICAgICAgICAgICAgIHZhciAkdGhpcyA9ICQodGhpcylcbiAgICAgICAgICAgICAgICAsIHdpZHRoID0gJHRoaXMub3V0ZXJXaWR0aCgpOyAvLyBjYWNoZSBmaXJzdCFcbiAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAkdGhpcy5kYXRlcGlja2VyKCd3aWRnZXQnKS5jc3MoJ3dpZHRoJywgd2lkdGgpO1xuICAgICAgICAgICAgICB9LCAxKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBvbkNsb3NlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgJCh0aGlzKS5yZW1vdmVDbGFzcygnb3BlbicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcblxuICAgICAgICAvLyBBZGp1c3Qgd2lkdGhcbiAgICAgICAgJGRhdGVwaWNrZXIub24oJ2ZvY3VzIGtleXVwJywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIHQgPSAkKHRoaXMpLCB3ID0gdC5vdXRlcldpZHRoKCk7XG4gICAgICAgICAgdC5kYXRlcGlja2VyKCd3aWRnZXQnKS5jc3MoJ3dpZHRoJywgdyk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH1cblxuICB9XG59O1xuIiwiZnVuY3Rpb24gdGVtcGxhdGUoaHRtbCwgZGF0YSkge1xuXG4gIHZhciBsb29wID0gL1xce0AoW159XSspXFx9KC4rPylcXHtcXC9cXDFcXH0vZ1xuICAgICwgbG9vcFZhcmlhYmxlID0gL1xceyMoW159XSspXFx9L2dcbiAgICAsIHZhcmlhYmxlID0gL1xceyhbXn1dKylcXH0vZztcblxuICByZXR1cm4gaHRtbFxuICAgIC5yZXBsYWNlKGxvb3AsIGZ1bmN0aW9uK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GZvciAodmFyIGkgPSAwLCBsZW4gPSBmb3JtYXQubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgICAgaWYgKC9tLy50ZXN0KGZvcm1hdFtpXSkpIG0gPSBkYXRlW2ldO1xuICAgICAgICBpZiAoL2QvLnRlc3QoZm9ybWF0W2ldKSkgZCA9IGRhdGVbaV07XG4gICAgICAgIGlmICgveS8udGVzdChmb3JtYXRbaV0pKSB5ID0gZGF0ZVtpXTtcbiAgICAgIH1cblxuICAgICAgaWYgKCFtIHx8ICFkIHx8ICF5KSByZXR1cm4gZmFsc2U7XG5cbiAgICAgIHJldHVybiBtID4gMCAmJiBtIDwgMTMgJiZcbiAgICAgICAgeSAmJiB5Lmxlbmd0aCA9PSA0ICYmXG4gICAgICAgIGQgPiAwICYmIGQgPD0gKG5ldyBEYXRlKHksIG0sIDApKS5nZXREYXRlKCk7XG4gICAgfVxuXG4gICAgcmV0dXJuIGlzRGF0ZSh0aGVEYXRlLCB0aGVGb3JtYXQpO1xuICB9XG5cbn07XG4iXX0= diff --git a/js/out/jquery.idealforms.min.js b/js/out/jquery.idealforms.min.js index 13f5cc6..1830dd7 100644 --- a/js/out/jquery.idealforms.min.js +++ b/js/out/jquery.idealforms.min.js @@ -4,4 +4,4 @@ * @version: 3.0 * @license GPL or MIT */ -!function(t){var i={};i.name="idealforms",i.defaults={field:".field",error:".error",iconHtml:"",iconClass:"icon",invalidClass:"invalid",validClass:"valid",silentLoad:!0,onValidate:t.noop,onSubmit:t.noop,rules:{},errors:{}},i.global={_format:function(e){var t=[].slice.call(arguments,1);return e.replace(/\{(\d)\}/g,function(e,i){return t[+i]||""}).replace(/\{\*([^*}]*)\}/g,function(e,i){return t.join(i||", ")})},_getKey:function(e,t){return e.split(".").reduce(function(e,t){return e&&e[t]},t)},i18n:{},ruleSeparator:" ",argSeparator:":",rules:e("./rules"),errors:e("./errors"),extensions:[e("./extensions/dynamic-fields/dynamic-fields.ext"),e("./extensions/ajax/ajax.ext"),e("./extensions/steps/steps.ext"),e("./extensions/custom-inputs/custom-inputs.ext"),e("./extensions/datepicker/datepicker.ext"),e("./extensions/adaptive/adaptive.ext")]},i.methods=t.extend({},e("./private"),e("./public")),e("./plugin")(i)}(jQuery,window,document)},{"./errors":1,"./extensions/adaptive/adaptive.ext":2,"./extensions/ajax/ajax.ext":3,"./extensions/custom-inputs/custom-inputs.ext":4,"./extensions/datepicker/datepicker.ext":7,"./extensions/dynamic-fields/dynamic-fields.ext":8,"./extensions/steps/steps.ext":10,"./plugin":12,"./private":13,"./public":14,"./rules":15}],12:[function(e,t){t.exports=function(){var e=Array.prototype;return function(t){function i(e,i){this.opts=$.extend({},t.defaults,i),this.el=e,this._name=t.name,this._init()}t=$.extend(!0,{name:"plugin",defaults:{disabledExtensions:"none"},methods:{},global:{}},t),$[t.name]=$.extend({addExtension:function(e){t.global.extensions.push(e)}},t.global),i._extended={},i.prototype._hasExtension=function(e){var i=this;return t.global.extensions.filter(function(t){return t.name==e&&i.opts.disabledExtensions.indexOf(t.name)<0}).length},i.prototype._extend=function(e){var t=this;$.each(e,function(e,s){$.extend(t.opts,$.extend(!0,s.options,t.opts)),$.each(s.methods,function(e,n){t.opts.disabledExtensions.indexOf(s.name)>-1||(i.prototype[e.split(":")[0]]?(i._extended[e]=i._extended[e]||[],i._extended[e].push({name:s.name,fn:n})):i.prototype[e]=n)})})},i.prototype._inject=function(e){var t=[].slice.call(arguments,1);if("function"==typeof e)return e.call(this);var s=this;i._extended[e]&&$.each(i._extended[e],function(e,i){i.fn.apply(s,t)})},i.prototype._init=$.noop,i.prototype[t.name]=function(t){if(!t)return this;try{return this[t].apply(this,e.slice.call(arguments,1))}catch(i){}},$.extend(i.prototype,t.methods),$.fn[t.name]=function(){var s,n=e.slice.call(arguments),a="string"==typeof n[0]&&n[0].split(":"),o=a[a.length>1?1:0],r=a.length>1&&a[0],l="object"==typeof n[0]&&n[0],d=n.slice(1);return r&&(o=r+o.substr(0,1).toUpperCase()+o.substr(1,o.length-1)),this.each(function(){var e=$.data(this,t.name);return e?s=e[t.name].apply(e,[o].concat(d)):$.data(this,t.name,new i(this,l))}),r?s:this}}}()},{}],13:[function(e,t){t.exports={_init:function(){var e=this;this.$form=$(this.el),this.$fields=$(),this.$inputs=$(),this._extend($.idealforms.extensions),this._i18n(),this._inject("_init"),this._addMarkupRules(),this.addRules(this.opts.rules||{}),this.$form.submit(function(t){e._validateAll(),e.focusFirstInvalid(),e.opts.onSubmit.call(e,e.getInvalid().length,t)}),this.opts.silentLoad||setTimeout($.proxy(this.focusFirstInvalid,this),1)},_addMarkupRules:function(){var e={};this.$form.find("input, select, textarea").each(function(){var t=$(this).data("idealforms-rules");t&&!e[this.name]&&(e[this.name]=t)}),this.addRules(e)},_i18n:function(){var e=this;$.each($.idealforms.i18n,function(t,i){var s=i.errors,n={};delete i.errors;for(var a in i)n[a]={i18n:i[a]};$.extend($.idealforms.errors,s),$.extend(!0,e.opts,n)})},_buildField:function(e){var t,i=this._getField(e);t=$(this.opts.iconHtml,{"class":this.opts.iconClass,click:function(){$(e).focus()}}),this.$fields.filter(i).length||(this.$fields=this.$fields.add(i),this.opts.iconHtml&&i.append(t),i.addClass("idealforms-field idealforms-field-"+e.type)),this._addEvents(e),this._inject("_buildField",e)},_addEvents:function(e){var t=this,i=this._getField(e);$(e).on("change keyup",function(e){9!=e.which&&16!=e.which&&t._validate(this,!0,!0)}).focus(function(){t.isValid(this.name)||i.find(t.opts.error).show()}).blur(function(){i.find(t.opts.error).hide()})},_isRequired:function(e){return $(e).is(":checkbox, :radio, select")?!0:this.opts.rules[e.name].indexOf("required")>-1},_getRelated:function(e){return this._getField(e).find('[name="'+e.name+'"]')},_getField:function(e){return $(e).closest(this.opts.field)},_getFirstInvalid:function(){return this.getInvalid().first().find("input:first, textarea, select")},_handleError:function(e,t,i){i=i||this.isValid(e.name);var s=this._getField(e).find(this.opts.error);this.$form.find(this.opts.error).hide(),t&&s.text(t),s.toggle(!i)},_handleStyle:function(e,t){t=t||this.isValid(e.name),this._getField(e).removeClass(this.opts.validClass+" "+this.opts.invalidClass).addClass(t?this.opts.validClass:this.opts.invalidClass).find("."+this.opts.iconClass).show()},_fresh:function(e){this._getField(e).removeClass(this.opts.validClass+" "+this.opts.invalidClass).find(this.opts.error).hide().end().find("."+this.opts.iconClass).toggle(this._isRequired(e))},_validate:function(e,t,i){var s,n=this,a=this._getField(e),o=this.opts.rules[e.name].split($.idealforms.ruleSeparator),r=a.data("idealforms-value"),l=!0;return $(e).is(":checkbox, :radio")||r!=e.value?(a.data("idealforms-value",e.value),e.value||this._isRequired(e)?$.each(o,function(o,r){r=r.split($.idealforms.argSeparator),s=r[0];var d,u=$.idealforms.rules[s],c=r.slice(1);return d=$.idealforms._format.apply(null,[$.idealforms._getKey("errors."+e.name+"."+s,n.opts)||$.idealforms.errors[s]].concat(c)),l="function"==typeof u?u.apply(n,[e,e.value].concat(c)):u.test(e.value),a.data("idealforms-valid",l),t&&n._handleError(e,d,l),i&&n._handleStyle(e,l),n.opts.onValidate.call(n,e,s,l),l}):(a.removeData("idealforms-valid"),this._fresh(e)),this._inject("_validate",e,s,l),l):a.data("idealforms-valid")},_validateAll:function(){var e=this;this.$inputs.each(function(){e._validate(this,!0)})}}},{}],14:[function(e,t){t.exports={addRules:function(e){var t=this,i=this.$form.find($.map(e,function(e,t){return'[name="'+t+'"]'}).join(","));$.extend(this.opts.rules,e),i.each(function(){t._buildField(this)}),this.$inputs=this.$inputs.add(i),this._validateAll(),this.$fields.find(this.opts.error).hide(),this._inject("addRules")},getInvalid:function(){return this.$fields.filter(function(){return $(this).data("idealforms-valid")===!1})},focusFirstInvalid:function(){var e=this._getFirstInvalid()[0];e&&(this._handleError(e),this._handleStyle(e),this._inject("focusFirstInvalid",e),$(e).focus())},isValid:function(e){return e?!this.getInvalid().find('[name="'+e+'"]').length:!this.getInvalid().length},reset:function(e){var t=this,i=this.$inputs;e&&(i=i.filter('[name="'+e+'"]')),i.filter("input:not(:checkbox, :radio)").val(""),i.filter(":checkbox, :radio").prop("checked",!1),i.filter("select").find("option").prop("selected",function(){return this.defaultSelected}),i.change().each(function(){t._fresh(this)}),this._inject("reset",e)}}},{}],15:[function(e,t){t.exports={required:/.+/,digits:/^\d+$/,email:/^[^@]+@[^@]+\..{2,6}$/,username:/^[a-z](?=[\w.]{3,31}$)\w*\.?\w*$/i,pass:/(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/,strongpass:/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,phone:/^[2-9]\d{2}-\d{3}-\d{4}$/,zip:/^\d{5}$|^\d{5}-\d{4}$/,url:/^(?:(ftp|http|https):\/\/)?(?:[\w\-]+\.)+[a-z]{2,6}([\:\/?#].*)?$/i,number:function(e,t){return!isNaN(t)},range:function(e,t,i,s){return Number(t)>=i&&Number(t)<=s},min:function(e,t,i){return t.length>=i},max:function(e,t,i){return t.length<=i},minoption:function(e,t,i){return this._getRelated(e).filter(":checked").length>=i},maxoption:function(e,t,i){return this._getRelated(e).filter(":checked").length<=i},minmax:function(e,t,i,s){return t.length>=i&&t.length<=s},select:function(e,t,i){return t!=i},extension:function(e){var t=[].slice.call(arguments,1),i=!1;return $.each(e.files||[{name:e.value}],function(e,s){i=$.inArray(s.name.split(".").pop().toLowerCase(),t)>-1}),i},equalto:function(e,t,i){var s=this,n=$('[name="'+i+'"]');return this.getInvalid().find(n).length?!1:(n.off("keyup.equalto").on("keyup.equalto",function(){s._getField(e).removeData("idealforms-value"),s._validate(e,!1,!0)}),e.value==n.val())},date:function(e,t,i){function s(e,t){for(var i,s,n,a=0,o=t.length;o>a;a++)/m/.test(t[a])&&(i=e[a]),/d/.test(t[a])&&(s=e[a]),/y/.test(t[a])&&(n=e[a]);return i&&s&&n?i>0&&13>i&&n&&4==n.length&&s>0&&s<=new Date(n,i,0).getDate():!1}i=i||"mm/dd/yyyy";var n=/[^mdy]/.exec(i)[0],a=i.split(n),o=t.split(n);return s(o,a)}}},{}]},{},[11]); \ No newline at end of file +!function(t){var i={};i.name="idealforms",i.defaults={field:".field",error:".error",iconHtml:"",iconClass:"icon",invalidClass:"invalid",validClass:"valid",silentLoad:!0,onValidate:t.noop,onSubmit:t.noop,rules:{},errors:{}},i.global={_format:function(e){var t=[].slice.call(arguments,1);return e.replace(/\{(\d)\}/g,function(e,i){return t[+i]||""}).replace(/\{\*([^*}]*)\}/g,function(e,i){return t.join(i||", ")})},_getKey:function(e,t){return e.split(".").reduce(function(e,t){return e&&e[t]},t)},i18n:{},ruleSeparator:" ",argSeparator:":",rules:e("./rules"),errors:e("./errors"),extensions:[e("./extensions/dynamic-fields/dynamic-fields.ext"),e("./extensions/ajax/ajax.ext"),e("./extensions/steps/steps.ext"),e("./extensions/custom-inputs/custom-inputs.ext"),e("./extensions/datepicker/datepicker.ext"),e("./extensions/adaptive/adaptive.ext")]},i.methods=t.extend({},e("./private"),e("./public")),e("./plugin")(i)}(jQuery,window,document)},{"./errors":1,"./extensions/adaptive/adaptive.ext":2,"./extensions/ajax/ajax.ext":3,"./extensions/custom-inputs/custom-inputs.ext":4,"./extensions/datepicker/datepicker.ext":7,"./extensions/dynamic-fields/dynamic-fields.ext":8,"./extensions/steps/steps.ext":10,"./plugin":12,"./private":13,"./public":14,"./rules":15}],12:[function(e,t){t.exports=function(){var e=Array.prototype;return function(t){function i(e,i){this.opts=$.extend({},t.defaults,i),this.el=e,this._name=t.name,this._init()}t=$.extend(!0,{name:"plugin",defaults:{disabledExtensions:"none"},methods:{},global:{}},t),$[t.name]=$.extend({addExtension:function(e){t.global.extensions.push(e)}},t.global),i._extended={},i.prototype._hasExtension=function(e){var i=this;return t.global.extensions.filter(function(t){return t.name==e&&i.opts.disabledExtensions.indexOf(t.name)<0}).length},i.prototype._extend=function(e){var t=this;$.each(e,function(e,s){$.extend(t.opts,$.extend(!0,s.options,t.opts)),$.each(s.methods,function(e,n){t.opts.disabledExtensions.indexOf(s.name)>-1||(i.prototype[e.split(":")[0]]?(i._extended[e]=i._extended[e]||[],i._extended[e].push({name:s.name,fn:n})):i.prototype[e]=n)})})},i.prototype._inject=function(e){var t=[].slice.call(arguments,1);if("function"==typeof e)return e.call(this);var s=this;i._extended[e]&&$.each(i._extended[e],function(e,i){i.fn.apply(s,t)})},i.prototype._init=$.noop,i.prototype[t.name]=function(t){if(!t)return this;try{return this[t].apply(this,e.slice.call(arguments,1))}catch(i){}},$.extend(i.prototype,t.methods),$.fn[t.name]=function(){var s,n=e.slice.call(arguments),a="string"==typeof n[0]&&n[0].split(":"),o=a[a.length>1?1:0],r=a.length>1&&a[0],l="object"==typeof n[0]&&n[0],d=n.slice(1);return r&&(o=r+o.substr(0,1).toUpperCase()+o.substr(1,o.length-1)),this.each(function(){var e=$.data(this,t.name);return e?s=e[t.name].apply(e,[o].concat(d)):$.data(this,t.name,new i(this,l))}),r?s:this}}}()},{}],13:[function(e,t){t.exports={_init:function(){var e=this;this.$form=$(this.el),this.$fields=$(),this.$inputs=$(),this._extend($.idealforms.extensions),this._i18n(),this._inject("_init"),this._addMarkupRules(),this.addRules(this.opts.rules||{}),this.$form.submit(function(t){e._validateAll(!0),e.focusFirstInvalid(),e.opts.onSubmit.call(e,e.getInvalid().length,t)}),this.opts.silentLoad||setTimeout($.proxy(this.focusFirstInvalid,this),1)},_addMarkupRules:function(){var e={};this.$form.find("input, select, textarea").each(function(){var t=$(this).data("idealforms-rules");t&&!e[this.name]&&(e[this.name]=t)}),this.addRules(e)},_i18n:function(){var e=this;$.each($.idealforms.i18n,function(t,i){var s=i.errors,n={};delete i.errors;for(var a in i)n[a]={i18n:i[a]};$.extend($.idealforms.errors,s),$.extend(!0,e.opts,n)})},_buildField:function(e){var t,i=this._getField(e);t=$(this.opts.iconHtml,{"class":this.opts.iconClass,click:function(){$(e).focus()}}),this.$fields.filter(i).length||(this.$fields=this.$fields.add(i),this.opts.iconHtml&&i.append(t),i.addClass("idealforms-field idealforms-field-"+e.type)),this._addEvents(e),this._inject("_buildField",e)},_addEvents:function(e){var t=this,i=this._getField(e);$(e).on("change keyup",function(e){9!=e.which&&16!=e.which&&t._validate(this,!0,!0)}).focus(function(){t.isValid(this.name)||i.find(t.opts.error).show()}).blur(function(){i.find(t.opts.error).hide()})},_isRequired:function(e){return $(e).is(":checkbox, :radio, select")?!0:this.opts.rules[e.name].indexOf("required")>-1},_getRelated:function(e){return this._getField(e).find('[name="'+e.name+'"]')},_getField:function(e){return $(e).closest(this.opts.field)},_getFirstInvalid:function(){return this.getInvalid().first().find("input:first, textarea, select")},_handleError:function(e,t,i){i=i||this.isValid(e.name);var s=this._getField(e).find(this.opts.error);this.$form.find(this.opts.error).hide(),t&&s.text(t),s.toggle(!i)},_handleStyle:function(e,t){t=t||this.isValid(e.name),this._getField(e).removeClass(this.opts.validClass+" "+this.opts.invalidClass).addClass(t?this.opts.validClass:this.opts.invalidClass).find("."+this.opts.iconClass).show()},_fresh:function(e){this._getField(e).removeClass(this.opts.validClass+" "+this.opts.invalidClass).find(this.opts.error).hide().end().find("."+this.opts.iconClass).toggle(this._isRequired(e))},_validate:function(e,t,i){var s,n=this,a=this._getField(e),o=this.opts.rules[e.name].split($.idealforms.ruleSeparator),r=a.data("idealforms-value"),l=!0;return $(e).is(":checkbox, :radio")||r!=e.value?(a.data("idealforms-value",e.value),e.value||this._isRequired(e)?$.each(o,function(o,r){r=r.split($.idealforms.argSeparator),s=r[0];var d,u=$.idealforms.rules[s],c=r.slice(1);return d=$.idealforms._format.apply(null,[$.idealforms._getKey("errors."+e.name+"."+s,n.opts)||$.idealforms.errors[s]].concat(c)),l="function"==typeof u?u.apply(n,[e,e.value].concat(c)):u.test(e.value),a.data("idealforms-valid",l),t&&n._handleError(e,d,l),i&&n._handleStyle(e,l),n.opts.onValidate.call(n,e,s,l),l}):(a.removeData("idealforms-valid"),this._fresh(e)),this._inject("_validate",e,s,l),l):a.data("idealforms-valid")},_validateAll:function(e,t){var i=this;this.$inputs.each(function(){i._validate(this,e,t)})}}},{}],14:[function(e,t){t.exports={addRules:function(e){var t=this,i=this.$form.find($.map(e,function(e,t){return'[name="'+t+'"]'}).join(","));$.extend(this.opts.rules,e),i.each(function(){t._buildField(this)}),this.$inputs=this.$inputs.add(i),this._validateAll(),this.$fields.find(this.opts.error).hide(),this._inject("addRules")},getInvalid:function(){return this.$fields.filter(function(){return $(this).data("idealforms-valid")===!1})},focusFirstInvalid:function(){var e=this._getFirstInvalid()[0];e&&(this._handleError(e),this._handleStyle(e),this._inject("focusFirstInvalid",e),$(e).focus())},isValid:function(e){return e?!this.getInvalid().find('[name="'+e+'"]').length:!this.getInvalid().length},reset:function(e){var t=this,i=this.$inputs;e&&(i=i.filter('[name="'+e+'"]')),i.filter("input:not(:checkbox, :radio), textarea").val(""),i.filter(":checkbox, :radio").prop("checked",!1),i.filter("select").find("option").prop("selected",function(){return this.defaultSelected}),i.change().each(function(){t._fresh(this)}),this._inject("reset",e)}}},{}],15:[function(e,t){t.exports={required:/.+/,digits:/^\d+$/,email:/^[^@]+@[^@]+\..{2,6}$/,username:/^[a-z](?=[\w.]{3,31}$)\w*\.?\w*$/i,pass:/(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/,strongpass:/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,phone:/^[2-9]\d{2}-\d{3}-\d{4}$/,zip:/^\d{5}$|^\d{5}-\d{4}$/,url:/^(?:(ftp|http|https):\/\/)?(?:[\w\-]+\.)+[a-z]{2,6}([\:\/?#].*)?$/i,number:function(e,t){return!isNaN(t)},range:function(e,t,i,s){return Number(t)>=i&&Number(t)<=s},min:function(e,t,i){return t.length>=i},max:function(e,t,i){return t.length<=i},minoption:function(e,t,i){return this._getRelated(e).filter(":checked").length>=i},maxoption:function(e,t,i){return this._getRelated(e).filter(":checked").length<=i},minmax:function(e,t,i,s){return t.length>=i&&t.length<=s},select:function(e,t,i){return t!=i},extension:function(e){var t=[].slice.call(arguments,1),i=!1;return $.each(e.files||[{name:e.value}],function(e,s){i=$.inArray(s.name.split(".").pop().toLowerCase(),t)>-1}),i},equalto:function(e,t,i){var s=this,n=$('[name="'+i+'"]');return this.getInvalid().find(n).length?!1:(n.off("keyup.equalto").on("keyup.equalto",function(){s._getField(e).removeData("idealforms-value"),s._validate(e,!1,!0)}),e.value==n.val())},date:function(e,t,i){function s(e,t){for(var i,s,n,a=0,o=t.length;o>a;a++)/m/.test(t[a])&&(i=e[a]),/d/.test(t[a])&&(s=e[a]),/y/.test(t[a])&&(n=e[a]);return i&&s&&n?i>0&&13>i&&n&&4==n.length&&s>0&&s<=new Date(n,i,0).getDate():!1}i=i||"mm/dd/yyyy";var n=/[^mdy]/.exec(i)[0],a=i.split(n),o=t.split(n);return s(o,a)}}},{}]},{},[11]); \ No newline at end of file diff --git a/js/private.js b/js/private.js index 4dbf470..565291c 100644 --- a/js/private.js +++ b/js/private.js @@ -20,7 +20,7 @@ module.exports = { this.addRules(this.opts.rules || {}); this.$form.submit(function(e) { - self._validateAll(); + self._validateAll(true); self.focusFirstInvalid(); self.opts.onSubmit.call(self, self.getInvalid().length, e); }); @@ -204,8 +204,8 @@ module.exports = { return valid; }, - _validateAll: function() { + _validateAll: function(handleStyle, handleError) { var self = this; - this.$inputs.each(function(){ self._validate(this, true); }); + this.$inputs.each(function(){ self._validate(this, handleStyle, handleError); }); } }; diff --git a/js/public.js b/js/public.js index 05cc1b6..cf22840 100644 --- a/js/public.js +++ b/js/public.js @@ -52,7 +52,7 @@ module.exports = { if (name) $inputs = $inputs.filter('[name="'+ name +'"]'); - $inputs.filter('input:not(:checkbox, :radio)').val(''); + $inputs.filter('input:not(:checkbox, :radio), textarea').val(''); $inputs.filter(':checkbox, :radio').prop('checked', false); $inputs.filter('select').find('option').prop('selected', function() { return this.defaultSelected;