/* * validate.js 1.4.1 * copyright (c) 2011 - 2014 rick harrison, http://rickharrison.me * validate.js is open sourced under the mit license. * portions of validate.js are inspired by codeigniter. * http://rickharrison.github.com/validate.js */ (function(q,r,m){var s={required:"the %s field is required.",matches:"the %s field does not match the %s field.","default":"the %s field is still set to default, please change.",valid_email:"the %s field must contain a valid email address.",valid_emails:"the %s field must contain all valid email addresses.",min_length:"the %s field must be at least %s characters in length.",max_length:"the %s field must not exceed %s characters in length.",exact_length:"the %s field must be exactly %s characters in length.", greater_than:"the %s field must contain a number greater than %s.",less_than:"the %s field must contain a number less than %s.",alpha:"the %s field must only contain alphabetical characters.",alpha_numeric:"the %s field must only contain alpha-numeric characters.",alpha_dash:"the %s field must only contain alpha-numeric characters, underscores, and dashes.",numeric:"the %s field must contain only numbers.",integer:"the %s field must contain an integer.",decimal:"the %s field must contain a decimal number.", is_natural:"the %s field must contain only positive numbers.",is_natural_no_zero:"the %s field must contain a number greater than zero.",valid_ip:"the %s field must contain a valid ip.",valid_base64:"the %s field must contain a base64 string.",valid_credit_card:"the %s field must contain a valid credit card number.",is_file_type:"the %s field must contain only %s files.",valid_url:"the %s field must contain a valid url."},t=function(a){},u=/^(.+?)\[(.+)\]$/,h=/^[0-9]+$/,v=/^\-?[0-9]+$/,k=/^\-?[0-9]*\.?[0-9]+$/, p=/^[a-za-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-za-z0-9](?:[a-za-z0-9-]{0,61}[a-za-z0-9])?(?:\.[a-za-z0-9](?:[a-za-z0-9-]{0,61}[a-za-z0-9])?)*$/,w=/^[a-z]+$/i,x=/^[a-z0-9]+$/i,y=/^[a-z0-9_\-]+$/i,z=/^[0-9]+$/i,a=/^[1-9][0-9]*$/i,b=/^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$/i,c=/[^a-za-z0-9\/\+=]/i,d=/^[\d\-\s]+$/,e=/^((http|https):\/\/(\w+:{0,1}\w*@)?(\s+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,f=function(a,b,c){this.callback=c||t;this.errors=[];this.fields= {};this.form=this._formbynameornode(a)||{};this.messages={};this.handlers={};this.conditionals={};a=0;for(c=b.length;a=parseint(b,10):!1},max_length:function(a,b){return h.test(b)?a.value.length<=parseint(b,10):!1},exact_length:function(a,b){return h.test(b)?a.value.length===parseint(b,10):!1},greater_than:function(a,b){return k.test(a.value)?parsefloat(a.value)>parsefloat(b):!1},less_than:function(a,b){return k.test(a.value)?parsefloat(a.value)