Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CRLF conversions

  • Loading branch information...
commit 5bb2441f04c0d5bf5cd2824f3778cfca1ec1b6ee 1 parent c738245
Jörn Zaefferer jzaefferer authored
Showing with 18,098 additions and 18,098 deletions.
  1. +259 −259 additional-methods.js
  2. +242 −242 changelog.txt
  3. +27 −27 demo/captcha/captcha.js
  4. +5 −5 demo/captcha/image_req.php
  5. +65 −65 demo/captcha/index.php
  6. +11 −11 demo/captcha/newsession.php
  7. +13 −13 demo/captcha/process.php
  8. +10 −10 demo/captcha/rand.php
  9. +10 −10 demo/captcha/style.css
  10. +40 −40 demo/css/cmxform.css
  11. +54 −54 demo/css/cmxformTemplate.css
  12. +13 −13 demo/css/core.css
  13. +60 −60 demo/css/reset.css
  14. +10 −10 demo/css/screen.css
  15. +91 −91 demo/custom-messages-metadata-demo.html
  16. +2 −2 demo/custom-methods-demo.html
  17. +55 −55 demo/dynamic-totals.html
  18. +7 −7 demo/index.html
  19. +1 −1  demo/js/chili-1.7.pack.js
  20. +9 −9 demo/marketo/emails.php
  21. +9 −9 demo/marketo/emails.phps
  22. +34 −34 demo/marketo/ie6.css
  23. +247 −247 demo/marketo/index.html
  24. +266 −266 demo/marketo/jquery.maskedinput.js
  25. +124 −124 demo/marketo/mktSignup.js
  26. +290 −290 demo/marketo/step2.htm
  27. +9 −9 demo/milk/emails.php
  28. +9 −9 demo/milk/emails.phps
  29. +4 −4 demo/milk/milk.css
  30. +11 −11 demo/milk/users.php
  31. +9 −9 demo/milk/users.phps
  32. +15 −15 demo/multipart/index.html
  33. +245 −245 demo/multipart/js/jquery.maskedinput-1.0.js
  34. +1 −1  demo/multipart/style.css
  35. +75 −75 demo/tinymce/index.html
  36. +10 −10 demo/tinymce/themes/simple/langs/en.js
  37. +32 −32 demo/tinymce/themes/simple/skins/default/ui.css
  38. +6,240 −6,240 lib/jquery-1.4.2.js
  39. +660 −660 lib/jquery.form.js
  40. +4,375 −4,375 lib/jquery.js
  41. +121 −121 lib/jquery.metadata.js
  42. +22 −22 localization/messages_bg.js
  43. +22 −22 localization/messages_cn.js
  44. +23 −23 localization/messages_cs.js
  45. +20 −20 localization/messages_da.js
  46. +19 −19 localization/messages_de.js
  47. +22 −22 localization/messages_es.js
  48. +22 −22 localization/messages_fr.js
  49. +20 −20 localization/messages_hu.js
  50. +22 −22 localization/messages_kk.js
  51. +22 −22 localization/messages_nl.js
  52. +22 −22 localization/messages_no.js
  53. +22 −22 localization/messages_pl.js
  54. +23 −23 localization/messages_ptbr.js
  55. +23 −23 localization/messages_ptpt.js
  56. +22 −22 localization/messages_ro.js
  57. +22 −22 localization/messages_ru.js
  58. +22 −22 localization/messages_tr.js
  59. +22 −22 localization/messages_tw.js
  60. +23 −23 localization/messages_ua.js
  61. +11 −11 localization/methods_de.js
  62. +8 −8 localization/methods_nl.js
  63. +8 −8 localization/methods_pt.js
  64. +23 −23 test/events.html
  65. +672 −672 test/firebug/firebug.js
  66. +9 −9 test/firebug/firebugx.js
  67. +23 −23 test/index-14.html
  68. +23 −23 test/index.html
  69. +22 −22 test/large.html
  70. +61 −61 test/messages.js
  71. +583 −583 test/methods.js
  72. +803 −803 test/qunit/testrunner.js
  73. +120 −120 test/qunit/testsuite.css
  74. +267 −267 test/rules.js
  75. +1,089 −1,089 test/test.js
  76. +10 −10 test/users.php
  77. +10 −10 test/users2.php
  78. +171 −171 todo
518 additional-methods.js
View
@@ -1,259 +1,259 @@
-(function() {
-
- function stripHtml(value) {
- // remove html tags and space chars
- return value.replace(/<.[^<>]*?>/g, ' ').replace(/&nbsp;|&#160;/gi, ' ')
- // remove numbers and punctuation
- .replace(/[0-9.(),;:!?%#$'"_+=\/-]*/g,'');
- }
- jQuery.validator.addMethod("maxWords", function(value, element, params) {
- return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length < params;
- }, jQuery.validator.format("Please enter {0} words or less."));
-
- jQuery.validator.addMethod("minWords", function(value, element, params) {
- return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params;
- }, jQuery.validator.format("Please enter at least {0} words."));
-
- jQuery.validator.addMethod("rangeWords", function(value, element, params) {
- return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params[0] && value.match(/bw+b/g).length < params[1];
- }, jQuery.validator.format("Please enter between {0} and {1} words."));
-
-})();
-
-jQuery.validator.addMethod("letterswithbasicpunc", function(value, element) {
- return this.optional(element) || /^[a-z-.,()'\"\s]+$/i.test(value);
-}, "Letters or punctuation only please");
-
-jQuery.validator.addMethod("alphanumeric", function(value, element) {
- return this.optional(element) || /^\w+$/i.test(value);
-}, "Letters, numbers, spaces or underscores only please");
-
-jQuery.validator.addMethod("lettersonly", function(value, element) {
- return this.optional(element) || /^[a-z]+$/i.test(value);
-}, "Letters only please");
-
-jQuery.validator.addMethod("nowhitespace", function(value, element) {
- return this.optional(element) || /^\S+$/i.test(value);
-}, "No white space please");
-
-jQuery.validator.addMethod("ziprange", function(value, element) {
- return this.optional(element) || /^90[2-5]\d\{2}-\d{4}$/.test(value);
-}, "Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx");
-
-jQuery.validator.addMethod("integer", function(value, element) {
- return this.optional(element) || /^-?\d+$/.test(value);
-}, "A positive or negative non-decimal number please");
-
-/**
-* Return true, if the value is a valid vehicle identification number (VIN).
-*
-* Works with all kind of text inputs.
-*
-* @example <input type="text" size="20" name="VehicleID" class="{required:true,vinUS:true}" />
-* @desc Declares a required input element whose value must be a valid vehicle identification number.
-*
-* @name jQuery.validator.methods.vinUS
-* @type Boolean
-* @cat Plugins/Validate/Methods
-*/
-jQuery.validator.addMethod(
- "vinUS",
- function(v){
- if (v.length != 17)
- return false;
- var i, n, d, f, cd, cdv;
- var LL = ["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"];
- var VL = [1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9];
- var FL = [8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];
- var rs = 0;
- for(i = 0; i < 17; i++){
- f = FL[i];
- d = v.slice(i,i+1);
- if(i == 8){
- cdv = d;
- }
- if(!isNaN(d)){
- d *= f;
- }
- else{
- for(n = 0; n < LL.length; n++){
- if(d.toUpperCase() === LL[n]){
- d = VL[n];
- d *= f;
- if(isNaN(cdv) && n == 8){
- cdv = LL[n];
- }
- break;
- }
- }
- }
- rs += d;
- }
- cd = rs % 11;
- if(cd == 10){cd = "X";}
- if(cd == cdv){return true;}
- return false;
- },
- "The specified vehicle identification number (VIN) is invalid."
-);
-
-/**
- * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy.
- *
- * @example jQuery.validator.methods.date("01/01/1900")
- * @result true
- *
- * @example jQuery.validator.methods.date("01/13/1990")
- * @result false
- *
- * @example jQuery.validator.methods.date("01.01.1900")
- * @result false
- *
- * @example <input name="pippo" class="{dateITA:true}" />
- * @desc Declares an optional input element whose value must be a valid date.
- *
- * @name jQuery.validator.methods.dateITA
- * @type Boolean
- * @cat Plugins/Validate/Methods
- */
-jQuery.validator.addMethod(
- "dateITA",
- function(value, element) {
- var check = false;
- var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
- if( re.test(value)){
- var adata = value.split('/');
- var gg = parseInt(adata[0],10);
- var mm = parseInt(adata[1],10);
- var aaaa = parseInt(adata[2],10);
- var xdata = new Date(aaaa,mm-1,gg);
- if ( ( xdata.getFullYear() == aaaa ) && ( xdata.getMonth () == mm - 1 ) && ( xdata.getDate() == gg ) )
- check = true;
- else
- check = false;
- } else
- check = false;
- return this.optional(element) || check;
- },
- "Please enter a correct date"
-);
-
-jQuery.validator.addMethod("dateNL", function(value, element) {
- return this.optional(element) || /^\d\d?[\.\/-]\d\d?[\.\/-]\d\d\d?\d?$/.test(value);
- }, "Vul hier een geldige datum in."
-);
-
-jQuery.validator.addMethod("time", function(value, element) {
- return this.optional(element) || /^([01][0-9])|(2[0123]):([0-5])([0-9])$/.test(value);
- }, "Please enter a valid time, between 00:00 and 23:59"
-);
-
-/**
- * matches US phone number format
- *
- * where the area code may not start with 1 and the prefix may not start with 1
- * allows '-' or ' ' as a separator and allows parens around area code
- * some people may want to put a '1' in front of their number
- *
- * 1(212)-999-2345
- * or
- * 212 999 2344
- * or
- * 212-999-0983
- *
- * but not
- * 111-123-5434
- * and not
- * 212 123 4567
- */
-jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
- phone_number = phone_number.replace(/\s+/g, "");
- return this.optional(element) || phone_number.length > 9 &&
- phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
-}, "Please specify a valid phone number");
-
-jQuery.validator.addMethod('phoneUK', function(phone_number, element) {
-return this.optional(element) || phone_number.length > 9 &&
-phone_number.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/);
-}, 'Please specify a valid phone number');
-
-jQuery.validator.addMethod('mobileUK', function(phone_number, element) {
-return this.optional(element) || phone_number.length > 9 &&
-phone_number.match(/^((0|\+44)7(5|6|7|8|9){1}\d{2}\s?\d{6})$/);
-}, 'Please specify a valid mobile number');
-
-// TODO check if value starts with <, otherwise don't try stripping anything
-jQuery.validator.addMethod("strippedminlength", function(value, element, param) {
- return jQuery(value).text().length >= param;
-}, jQuery.validator.format("Please enter at least {0} characters"));
-
-// same as email, but TLD is optional
-jQuery.validator.addMethod("email2", function(value, element, param) {
- return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);
-}, jQuery.validator.messages.email);
-
-// same as url, but TLD is optional
-jQuery.validator.addMethod("url2", function(value, element, param) {
- return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
-}, jQuery.validator.messages.url);
-
-// NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator
-// Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0
-// Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings)
-jQuery.validator.addMethod("creditcardtypes", function(value, element, param) {
-
- if (/[^0-9-]+/.test(value))
- return false;
-
- value = value.replace(/\D/g, "");
-
- var validTypes = 0x0000;
-
- if (param.mastercard)
- validTypes |= 0x0001;
- if (param.visa)
- validTypes |= 0x0002;
- if (param.amex)
- validTypes |= 0x0004;
- if (param.dinersclub)
- validTypes |= 0x0008;
- if (param.enroute)
- validTypes |= 0x0010;
- if (param.discover)
- validTypes |= 0x0020;
- if (param.jcb)
- validTypes |= 0x0040;
- if (param.unknown)
- validTypes |= 0x0080;
- if (param.all)
- validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080;
-
- if (validTypes & 0x0001 && /^(51|52|53|54|55)/.test(value)) { //mastercard
- return value.length == 16;
- }
- if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa
- return value.length == 16;
- }
- if (validTypes & 0x0004 && /^(34|37)/.test(value)) { //amex
- return value.length == 15;
- }
- if (validTypes & 0x0008 && /^(300|301|302|303|304|305|36|38)/.test(value)) { //dinersclub
- return value.length == 14;
- }
- if (validTypes & 0x0010 && /^(2014|2149)/.test(value)) { //enroute
- return value.length == 15;
- }
- if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover
- return value.length == 16;
- }
- if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb
- return value.length == 16;
- }
- if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb
- return value.length == 15;
- }
- if (validTypes & 0x0080) { //unknown
- return true;
- }
- return false;
-}, "Please enter a valid credit card number.");
+(function() {
+
+ function stripHtml(value) {
+ // remove html tags and space chars
+ return value.replace(/<.[^<>]*?>/g, ' ').replace(/&nbsp;|&#160;/gi, ' ')
+ // remove numbers and punctuation
+ .replace(/[0-9.(),;:!?%#$'"_+=\/-]*/g,'');
+ }
+ jQuery.validator.addMethod("maxWords", function(value, element, params) {
+ return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length < params;
+ }, jQuery.validator.format("Please enter {0} words or less."));
+
+ jQuery.validator.addMethod("minWords", function(value, element, params) {
+ return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params;
+ }, jQuery.validator.format("Please enter at least {0} words."));
+
+ jQuery.validator.addMethod("rangeWords", function(value, element, params) {
+ return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params[0] && value.match(/bw+b/g).length < params[1];
+ }, jQuery.validator.format("Please enter between {0} and {1} words."));
+
+})();
+
+jQuery.validator.addMethod("letterswithbasicpunc", function(value, element) {
+ return this.optional(element) || /^[a-z-.,()'\"\s]+$/i.test(value);
+}, "Letters or punctuation only please");
+
+jQuery.validator.addMethod("alphanumeric", function(value, element) {
+ return this.optional(element) || /^\w+$/i.test(value);
+}, "Letters, numbers, spaces or underscores only please");
+
+jQuery.validator.addMethod("lettersonly", function(value, element) {
+ return this.optional(element) || /^[a-z]+$/i.test(value);
+}, "Letters only please");
+
+jQuery.validator.addMethod("nowhitespace", function(value, element) {
+ return this.optional(element) || /^\S+$/i.test(value);
+}, "No white space please");
+
+jQuery.validator.addMethod("ziprange", function(value, element) {
+ return this.optional(element) || /^90[2-5]\d\{2}-\d{4}$/.test(value);
+}, "Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx");
+
+jQuery.validator.addMethod("integer", function(value, element) {
+ return this.optional(element) || /^-?\d+$/.test(value);
+}, "A positive or negative non-decimal number please");
+
+/**
+* Return true, if the value is a valid vehicle identification number (VIN).
+*
+* Works with all kind of text inputs.
+*
+* @example <input type="text" size="20" name="VehicleID" class="{required:true,vinUS:true}" />
+* @desc Declares a required input element whose value must be a valid vehicle identification number.
+*
+* @name jQuery.validator.methods.vinUS
+* @type Boolean
+* @cat Plugins/Validate/Methods
+*/
+jQuery.validator.addMethod(
+ "vinUS",
+ function(v){
+ if (v.length != 17)
+ return false;
+ var i, n, d, f, cd, cdv;
+ var LL = ["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"];
+ var VL = [1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9];
+ var FL = [8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];
+ var rs = 0;
+ for(i = 0; i < 17; i++){
+ f = FL[i];
+ d = v.slice(i,i+1);
+ if(i == 8){
+ cdv = d;
+ }
+ if(!isNaN(d)){
+ d *= f;
+ }
+ else{
+ for(n = 0; n < LL.length; n++){
+ if(d.toUpperCase() === LL[n]){
+ d = VL[n];
+ d *= f;
+ if(isNaN(cdv) && n == 8){
+ cdv = LL[n];
+ }
+ break;
+ }
+ }
+ }
+ rs += d;
+ }
+ cd = rs % 11;
+ if(cd == 10){cd = "X";}
+ if(cd == cdv){return true;}
+ return false;
+ },
+ "The specified vehicle identification number (VIN) is invalid."
+);
+
+/**
+ * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy.
+ *
+ * @example jQuery.validator.methods.date("01/01/1900")
+ * @result true
+ *
+ * @example jQuery.validator.methods.date("01/13/1990")
+ * @result false
+ *
+ * @example jQuery.validator.methods.date("01.01.1900")
+ * @result false
+ *
+ * @example <input name="pippo" class="{dateITA:true}" />
+ * @desc Declares an optional input element whose value must be a valid date.
+ *
+ * @name jQuery.validator.methods.dateITA
+ * @type Boolean
+ * @cat Plugins/Validate/Methods
+ */
+jQuery.validator.addMethod(
+ "dateITA",
+ function(value, element) {
+ var check = false;
+ var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
+ if( re.test(value)){
+ var adata = value.split('/');
+ var gg = parseInt(adata[0],10);
+ var mm = parseInt(adata[1],10);
+ var aaaa = parseInt(adata[2],10);
+ var xdata = new Date(aaaa,mm-1,gg);
+ if ( ( xdata.getFullYear() == aaaa ) && ( xdata.getMonth () == mm - 1 ) && ( xdata.getDate() == gg ) )
+ check = true;
+ else
+ check = false;
+ } else
+ check = false;
+ return this.optional(element) || check;
+ },
+ "Please enter a correct date"
+);
+
+jQuery.validator.addMethod("dateNL", function(value, element) {
+ return this.optional(element) || /^\d\d?[\.\/-]\d\d?[\.\/-]\d\d\d?\d?$/.test(value);
+ }, "Vul hier een geldige datum in."
+);
+
+jQuery.validator.addMethod("time", function(value, element) {
+ return this.optional(element) || /^([01][0-9])|(2[0123]):([0-5])([0-9])$/.test(value);
+ }, "Please enter a valid time, between 00:00 and 23:59"
+);
+
+/**
+ * matches US phone number format
+ *
+ * where the area code may not start with 1 and the prefix may not start with 1
+ * allows '-' or ' ' as a separator and allows parens around area code
+ * some people may want to put a '1' in front of their number
+ *
+ * 1(212)-999-2345
+ * or
+ * 212 999 2344
+ * or
+ * 212-999-0983
+ *
+ * but not
+ * 111-123-5434
+ * and not
+ * 212 123 4567
+ */
+jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
+ phone_number = phone_number.replace(/\s+/g, "");
+ return this.optional(element) || phone_number.length > 9 &&
+ phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
+}, "Please specify a valid phone number");
+
+jQuery.validator.addMethod('phoneUK', function(phone_number, element) {
+return this.optional(element) || phone_number.length > 9 &&
+phone_number.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/);
+}, 'Please specify a valid phone number');
+
+jQuery.validator.addMethod('mobileUK', function(phone_number, element) {
+return this.optional(element) || phone_number.length > 9 &&
+phone_number.match(/^((0|\+44)7(5|6|7|8|9){1}\d{2}\s?\d{6})$/);
+}, 'Please specify a valid mobile number');
+
+// TODO check if value starts with <, otherwise don't try stripping anything
+jQuery.validator.addMethod("strippedminlength", function(value, element, param) {
+ return jQuery(value).text().length >= param;
+}, jQuery.validator.format("Please enter at least {0} characters"));
+
+// same as email, but TLD is optional
+jQuery.validator.addMethod("email2", function(value, element, param) {
+ return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);
+}, jQuery.validator.messages.email);
+
+// same as url, but TLD is optional
+jQuery.validator.addMethod("url2", function(value, element, param) {
+ return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
+}, jQuery.validator.messages.url);
+
+// NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator
+// Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0
+// Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings)
+jQuery.validator.addMethod("creditcardtypes", function(value, element, param) {
+
+ if (/[^0-9-]+/.test(value))
+ return false;
+
+ value = value.replace(/\D/g, "");
+
+ var validTypes = 0x0000;
+
+ if (param.mastercard)
+ validTypes |= 0x0001;
+ if (param.visa)
+ validTypes |= 0x0002;
+ if (param.amex)
+ validTypes |= 0x0004;
+ if (param.dinersclub)
+ validTypes |= 0x0008;
+ if (param.enroute)
+ validTypes |= 0x0010;
+ if (param.discover)
+ validTypes |= 0x0020;
+ if (param.jcb)
+ validTypes |= 0x0040;
+ if (param.unknown)
+ validTypes |= 0x0080;
+ if (param.all)
+ validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080;
+
+ if (validTypes & 0x0001 && /^(51|52|53|54|55)/.test(value)) { //mastercard
+ return value.length == 16;
+ }
+ if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa
+ return value.length == 16;
+ }
+ if (validTypes & 0x0004 && /^(34|37)/.test(value)) { //amex
+ return value.length == 15;
+ }
+ if (validTypes & 0x0008 && /^(300|301|302|303|304|305|36|38)/.test(value)) { //dinersclub
+ return value.length == 14;
+ }
+ if (validTypes & 0x0010 && /^(2014|2149)/.test(value)) { //enroute
+ return value.length == 15;
+ }
+ if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover
+ return value.length == 16;
+ }
+ if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb
+ return value.length == 16;
+ }
+ if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb
+ return value.length == 15;
+ }
+ if (validTypes & 0x0080) { //unknown
+ return true;
+ }
+ return false;
+}, "Please enter a valid credit card number.");
484 changelog.txt
View
@@ -1,243 +1,243 @@
-1.x
----
-* Improved NL localization (http://plugins.jquery.com/node/14120)
-
-1.7
----
-* Added Lithuanian (LT) localization
-* Added Greek (EL) localization (http://plugins.jquery.com/node/12319)
-* Added Latvian (LV) localization (http://plugins.jquery.com/node/12349)
-* Added Hebrew (HE) localization (http://plugins.jquery.com/node/12039)
-* Fixed Spanish (ES) localization (http://plugins.jquery.com/node/12696)
-* Added jQuery UI themerolled demo
-* Removed cmxform.js
-* Fixed four missing semicolons (http://plugins.jquery.com/node/12639)
-* Renamed phone-method in additional-methods.js to phoneUS
-* Added phoneUK and mobileUK methods to additional-methods.js (http://plugins.jquery.com/node/12359)
-* Deep extend options to avoid modifying multiple forms when using the rules-method on a single element (http://plugins.jquery.com/node/12411)
-* Bugfixes for compability with jQuery 1.4.2, while maintaining backwards-compability
-
-1.6
----
-* Added Arabic (AR), Portuguese (PTPT), Persian (FA), Finnish (FI) and Bulgarian (BR) localization
-* Updated Swedish (SE) localization (some missing html iso characters)
-* Fixed $.validator.addMethod to properly handle empty string vs. undefined for the message argument
-* Fixed two accidental global variables
-* Enhanced min/max/rangeWords (in additional-methods.js) to strip html before counting; good when counting words in a richtext editor
-* Added localized methods for DE, NL and PT, removing the dateDE and numberDE methods (use messages_de.js and methods_de.js with date and number methods instead)
-* Fixed remote form submit synchronization, kudos to Matas Petrikas
-* Improved interactive select validation, now validating also on click (via option or select, inconsistent across browsers); doesn't work in Safari, which doesn't trigger a click event at all on select elements; fixes http://plugins.jquery.com/node/11520
-* Updated to latest form plugin (2.36), fixing http://plugins.jquery.com/node/11487
-* Bind to blur event for equalTo target to revalidate when that target changes, fixes http://plugins.jquery.com/node/11450
-* Simplified select validation, delegating to jQuery's val() method to get the select value; should fix http://plugins.jquery.com/node/11239
-* Fixed default message for digits (http://plugins.jquery.com/node/9853)
-* Fixed issue with cached remote message (http://plugins.jquery.com/node/11029 and http://plugins.jquery.com/node/9351)
-* Fixed a missing semicolon in additional-methods.js (http://plugins.jquery.com/node/9233)
-* Added automatic detection of substitution parameters in messages, removing the need to provide format functions (http://plugins.jquery.com/node/11195)
-* Fixed an issue with :filled/:blank somewhat caused by Sizzle (http://plugins.jquery.com/node/11144)
-* Added an integer method to additional-methods.js (http://plugins.jquery.com/node/9612)
-* Fixed errorsFor method where the for-attribute contains characters that need escaping to be valid inside a selector (http://plugins.jquery.com/node/9611)
-
-1.5.5
----
-* Fix for http://plugins.jquery.com/node/8659
-* Fixed trailing comma in messages_cs.js
-
-1.5.4
----
-* Fixed remote method bug (http://plugins.jquery.com/node/8658)
-
-1.5.3
----
-* Fixed a bug related to the wrapper-option, where all ancestor-elements that matched the wrapper-option where selected (http://plugins.jquery.com/node/7624)
-* Updated multipart demo to use latest jQuery UI accordion
-* Added dateNL and time methods to additionalMethods.js
-* Added Traditional Chinese (Taiwan, tw) and Kazakhstan (KK) localization
-* Moved jQuery.format (fomerly String.format) to jQuery.validator.format, jQuery.format is deprecated and will be removed in 1.6 (see http://code.google.com/p/jquery-utils/issues/detail?id=15 for details)
-* Cleaned up messages_pl.js and messages_ptbr.js (still defined messages for max/min/rangeValue, which were removed in 1.4)
-* Fixed flawed boolean logic in valid-plugin-method for multiple elements; now all elements need to be valid for a boolean-true result (http://plugins.jquery.com/node/8481)
-* Enhancement $.validator.addMethod: An undefined third message-argument won't overwrite an existing message (http://plugins.jquery.com/node/8443)
-* Enhancement to submitHandler option: When used, click events on submit buttons are captured and the submitting button is inserted into the form before calling submitHandler, and removed afterwards; keeps submit buttons intact (http://plugins.jquery.com/node/7183#comment-3585)
-* Added option validClass, default "valid", which adds that class to all valid elements, after validation (http://dev.jquery.com/ticket/2205)
-* Added creditcardtypes method to additionalMethods.js, including tests (via http://dev.jquery.com/ticket/3635)
-* Improved remote method to allow serverside message as a string, or true for valid, or false for invalid using the clientside defined message (http://dev.jquery.com/ticket/3807)
-* Improved accept method to also accept a Drupal-style comma-seperated list of values (http://plugins.jquery.com/node/8580)
-
-1.5.2
----
-* Fixed messages in additional-methods.js for maxWords, minWords, and rangeWords to include call to $.format
-* Fixed value passed to methods to exclude carriage return (\r), same as jQuery's val() does
-* Added slovak (sk) localization
-* Added demo for intergration with jQuery UI tabs
-* Added selects-grouping example to tabs demo (see second tab, birthdate field)
-
-1.5.1
----
-* Updated marketo demo to use invalidHandler option instead of binding invalid-form event
-* Added TinyMCE integration example
-* Added ukrainian (ua) localization
-* Fixed length validation to work with trimmed value (regression from 1.5 where general trimming before validation was removed)
-* Various small fixes for compability with both 1.2.6 and 1.3
-
-1.5
----
-* Improved basic demo, validating confirm-password field after password changed
-* Fixed basic validation to pass the untrimmed input value as the first parameter to validation methods, changed required accordingly; breaks existing custom method that rely on the trimming
-* Added norwegian (no), italian (it), hungarian (hu) and romanian (ro) localization
-* Fixed #3195: Two flaws in swedish localization
-* Fixed #3503: Extended rules("add") to accept messages propery: use to specify add custom messages to an element via rules("add", { messages: { required: "Required! " } });
-* Fixed #3356: Regression from #2908 when using meta-option
-* Fixed #3370: Added ignoreTitle option, set to skip reading messages from the title attribute, helps to avoid issues with Google Toolbar; default is false for compability
-* Fixed #3516: Trigger invalid-form event even when remote validation is involved
-* Added invalidHandler option as a shortcut to bind("invalid-form", function() {})
-* Fixed Safari issue for loading indicator in ajaxSubmit-integration-demo (append to body first, then hide)
-* Added test for creditcard validation and improved default message
-* Enhanced remote validation, accepting options to passthrough to $.ajax as paramter (either url string or options, including url property plus everything else that $.ajax supports)
-
-1.4
----
-* Fixed #2931, validate elements in document order and ignore type=image inputs
-* Fixed usage of $ and jQuery variables, now fully comptible with all variations of noConflict usage
-* Implemented #2908, enabling custom messages via metadata ala class="{required:true,messages:{required:'required field'}}", added demo/custom-messages-metadata-demo.html
-* Removed deprecated methods minValue (min), maxValue (max), rangeValue (rangevalue), minLength (minlength), maxLength (maxlength), rangeLength (rangelength)
-* Fixed #2215 regression: Call unhighlight only for current elements, not everything
-* Implemented #2989, enabling image button to cancel validation
-* Fixed issue where IE incorrectly validates against maxlength=0
-* Added czech (cs) localization
-* Reset validator.submitted on validator.resetForm(), enabling a full reset when necessary
-* Fixed #3035, skipping all falsy attributes when reading rules (0, undefined, empty string), removed part of the maxlength workaround (for 0)
-* Added dutch (nl) localization (#3201)
-
-1.3
----
-* Fixed invalid-form event, now only triggered when form is invalid
-* Added spanish (es), russian (ru), portuguese brazilian (ptbr), turkish (tr), and polish (pl) localization
-* Added removeAttrs plugin to facilate adding and removing multiple attributes
-* Added groups option to display a single message for multiple elements, via groups: { arbitraryGroupName: "fieldName1 fieldName2[, fieldNameN" }
-* Enhanced rules() for adding and removing (static) rules: rules("add", "method1[, methodN]"/{method1:param[, method_n:param]}) and rules("remove"[, "method1[, method_n]")
-* Enhanced rules-option, accepts space-seperated string-list of methods, eg. {birthdate: "required date"}
-* Fixed checkbox group validation with inline rules: As long as the rules are specified on the first element, the group is now properly validated on click
-* Fixed #2473, ignoring all rules with an explicit parameter of boolean-false, eg. required:false is the same as not specifying required at all (it was handled as required:true so far)
-* Fixed #2424, with a modified patch from #2473: Methods returning a dependency-mismatch don't stop other rules from being evaluated anymore; still, success isn't applied for optional fields
-* Fixed url and email validation to not use trimmed values
-* Fixed creditcard validation to accept only digits and dashes ("asdf" is not a valid creditcard number)
-* Allow both button and input elements for cancel buttons (via class="cancel")
-* Fixed #2215: Fixed message display to call unhighlight as part of showing and hiding messages, no more visual side-effects while checking an element and extracted validator.checkForm to validate a form without UI sideeffects
-* Rewrote custom selectors (:blank, :filled, :unchecked) with functions for compability with AIR
-
-1.2.1
------
-
-* Bundled delegeate plugin with validate plugin - its always required anyway
-* Improved remote validation to include parts from the ajaxQueue plugin for proper synchronization (no additional plugin necessary)
-* Fixed stopRequest to prevent pendingRequest < 0
-* Added jQuery.validator.autoCreateRanges property, defaults to false, enable to convert min/max to range and minlength/maxlength to rangelength; this basically fixes the issue introduced by automatically creating ranges in 1.2
-* Fixed optional-methods to not highlight anything at all if the field is blank, that is, don't trigger success
-* Allow false/null for highlight/unhighlight options instead of forcing a do-nothing-callback even when nothing needs to be highlighted
-* Fixed validate() call with no elements selected, returning undefined instead of throwing an error
-* Improved demo, replacing metadata with classes/attributes for specifying rules
-* Fixed error when no custom message is used for remote validation
-* Modified email and url validation to require domain label and top label
-* Fixed url and email validation to require TLD (actually to require domain label); 1.2 version (TLD is optional) is moved to additionals as url2 and email2
-* Fixed dynamic-totals demo in IE6/7 and improved templating, using textarea to store multiline template and string interpolation
-* Added login form example with "Email password" link that makes the password field optional
-* Enhanced dynamic-totals demo with an example of a single message for two fields
-
-1.2
----
-
-* Added AJAX-captcha validation example (based on http://psyrens.com/captcha/)
-* Added remember-the-milk-demo (thanks RTM team for the permission!)
-* Added marketo-demo (thanks Glen Lipka!)
-* Added support for ajax-validation, see method "remote"; serverside returns JSON, true for valid elements, false or a String for invalid, String is used as message
-* Added highlight and unhighlight options, by default toggles errorClass on element, allows custom highlighting
-* Added valid() plugin method for easy programmatic checking of forms and fields without the need to use the validator API
-* Added rules() plguin method to read and write rules for an element (currently read only)
-* Replaced regex for email method, thanks to the contribution by Scott Gonzalez, see http://projects.scottsplayground.com/email_address_validation/
-* Restructured event architecture to rely solely on delegation, both improving performance, and ease-of-use for the developer (requires jquery.delegate.js)
-* Moved documentation from inline to http://docs.jquery.com/Plugins/Validation - including interactive examples for all methods
-* Removed validator.refresh(), validation is now completey dynamic
-* Renamed minValue to min, maxValue to max and rangeValue to range, deprecating the previous names (to be removed in 1.3)
-* Renamed minLength to minlength, maxLength to maxlength and rangeLength to rangelength, deprecating the previous names (to be removed in 1.3)
-* Added feature to merge min + max into and range and minlength + maxlength into rangelength
-* Added support for dynamic rule parameters, allowing to specify a function as a parameter eg. for minlength, called when validating the element
-* Allow to specify null or an empty string as a message to display nothing (see marketo demo)
-* Rules overhaul: Now supports combination of rules-option, metadata, classes (new) and attributes (new), see rules() for details
-
-1.1.2
----
-
-* Replaced regex for URL method, thanks to the contribution by Scott Gonzalez, see http://projects.scottsplayground.com/iri/
-* Improved email method to better handle unicode characters
-* Fixed error container to hide when all elements are valid, not only on form submit
-* Fixed String.format to jQuery.format (moving into jQuery namespace)
-* Fixed accept method to accept both upper and lowercase extensions
-* Fixed validate() plugin method to create only one validator instance for a given form and always return that one instance (avoids binding events multiple times)
-* Changed debug-mode console log from "error" to "warn" level
-
-1.1.1
------
-
-* Fixed invalid XHTML, preventing error label creation in IE since jQuery 1.1.4
-* Fixed and improved String.format: Global search & replace, better handling of array arguments
-* Fixed cancel-button handling to use validator-object for storing state instead of form element
-* Fixed name selectors to handle "complex" names, eg. containing brackets ("list[]")
-* Added button and disabled elements to exclude from validation
-* Moved element event handlers to refresh to be able to add handlers to new elements
-* Fixed email validation to allow long top level domains (eg. ".travel")
-* Moved showErrors() from valid() to form()
-* Added validator.size(): returns the number of current errors
-* Call submitHandler with validator as scope for easier access of it's methods, eg. to find error labels using errorsFor(Element)
-* Compatible with jQuery 1.1.x and 1.2.x
-
-1.1
----
-
-* Added validation on blur, keyup and click (for checkboxes and radiobutton). Replaces event-option.
-* Fixed resetForm
-* Fixed custom-methods-demo
-
-1.0
----
-
-* Improved number and numberDE methods to check for correct decimal numbers with delimiters
-* Only elements that have rules are checked (otherwise success-option is applied to all elements)
-* Added creditcard number method (thanks to Brian Klug)
-* Added ignore-option, eg. ignore: "[@type=hidden]", using that expression to exclude elements to validate. Default: none, though submit and reset buttons are always ignored
-* Heavily enhanced Functions-as-messages by providing a flexible String.format helper
-* Accept Functions as messages, providing runtime-custom-messages
-* Fixed exclusion of elements without rules from successList
-* Fixed custom-method-demo, replaced the alert with message displaying the number of errors
-* Fixed form-submit-prevention when using submitHandler
-* Completely removed dependency on element IDs, though they are still used (when present) to link error labels to inputs. Achieved by using
- an array with {name, message, element} instead of an object with id:message pairs for the internal errorList.
-* Added support for specifying simple rules as simple strings, eg. "required" is equivalent to {required: true}
-* Added feature: Add errorClass to invalid field�s parent element, making it easy to style the label/field container or the label for the field.
-* Added feature: focusCleanup - If enabled, removes the errorClass from the invalid elements and hides all errors messages whenever the element is focused.
-* Added success option to show the a field was validated successfully
-* Fixed Opera select-issue (avoiding a attribute-collision)
-* Fixed problems with focussing hidden elements in IE
-* Added feature to skip validation for submit buttons with class "cancel"
-* Fixed potential issues with Google Toolbar by prefering plugin option messages over title attribute
-* submitHandler is only called when an actual submit event was handled, validator.form() returns false only for invalid forms
-* Invalid elements are now focused only on submit or via validator.focusInvalid(), avoiding all trouble with focus-on-blur
-* IE6 error container layout issue is solved
-* Customize error element via errorElement option
-* Added validator.refresh() to find new inputs in the form
-* Added accept validation method, checks file extensions
-* Improved dependecy feature by adding two custom expressions: ":blank" to select elements with an empty value and �:filled� to select elements with a value, both excluding whitespace
-* Added a resetForm() method to the validator: Resets each form element (using the form plugin, if available), removes classes on invalid elements and hides all error messages
-* Fixed docs for validator.showErrors()
-* Fixed error label creation to always use html() instead of text(), allowing arbitrary HTML passed in as messages
-* Fixed error label creation to use specified error class
-* Added dependency feature: The requires method accepts both String (jQuery expressions) and Functions as the argument
-* Heavily improved customizing of error message display: Use normal messages and show/hide an additional container; Completely replace message display with own mechanism (while being able to delegate to the default handler; Customize placing of generated labels (instead of default below-element)
-* Fixed two major bugs in IE (error containers) and Opera (metadata)
-* Modified validation methods to accept empty fields as valid (exception: of course �required� and also �equalTo� methods)
-* Renamed "min" to "minLength", "max" to "maxLength", "length" to "rangeLength"
-* Added "minValue", "maxValue" and "rangeValue"
-* Streamlined API for support of different events. The default, submit, can be disabled. If any event is specified, that is applied to each element (instead of the entire form). Combining keyup-validation with submit-validation is now extremely easy to setup
-* Added support for one-message-per-rule when defining messages via plugin settings
-* Added support to wrap metadata in some parent element. Useful when metadata is used for other plugins, too.
-* Refactored tests and demos: Less files, better demos
+1.x
+---
+* Improved NL localization (http://plugins.jquery.com/node/14120)
+
+1.7
+---
+* Added Lithuanian (LT) localization
+* Added Greek (EL) localization (http://plugins.jquery.com/node/12319)
+* Added Latvian (LV) localization (http://plugins.jquery.com/node/12349)
+* Added Hebrew (HE) localization (http://plugins.jquery.com/node/12039)
+* Fixed Spanish (ES) localization (http://plugins.jquery.com/node/12696)
+* Added jQuery UI themerolled demo
+* Removed cmxform.js
+* Fixed four missing semicolons (http://plugins.jquery.com/node/12639)
+* Renamed phone-method in additional-methods.js to phoneUS
+* Added phoneUK and mobileUK methods to additional-methods.js (http://plugins.jquery.com/node/12359)
+* Deep extend options to avoid modifying multiple forms when using the rules-method on a single element (http://plugins.jquery.com/node/12411)
+* Bugfixes for compability with jQuery 1.4.2, while maintaining backwards-compability
+
+1.6
+---
+* Added Arabic (AR), Portuguese (PTPT), Persian (FA), Finnish (FI) and Bulgarian (BR) localization
+* Updated Swedish (SE) localization (some missing html iso characters)
+* Fixed $.validator.addMethod to properly handle empty string vs. undefined for the message argument
+* Fixed two accidental global variables
+* Enhanced min/max/rangeWords (in additional-methods.js) to strip html before counting; good when counting words in a richtext editor
+* Added localized methods for DE, NL and PT, removing the dateDE and numberDE methods (use messages_de.js and methods_de.js with date and number methods instead)
+* Fixed remote form submit synchronization, kudos to Matas Petrikas
+* Improved interactive select validation, now validating also on click (via option or select, inconsistent across browsers); doesn't work in Safari, which doesn't trigger a click event at all on select elements; fixes http://plugins.jquery.com/node/11520
+* Updated to latest form plugin (2.36), fixing http://plugins.jquery.com/node/11487
+* Bind to blur event for equalTo target to revalidate when that target changes, fixes http://plugins.jquery.com/node/11450
+* Simplified select validation, delegating to jQuery's val() method to get the select value; should fix http://plugins.jquery.com/node/11239
+* Fixed default message for digits (http://plugins.jquery.com/node/9853)
+* Fixed issue with cached remote message (http://plugins.jquery.com/node/11029 and http://plugins.jquery.com/node/9351)
+* Fixed a missing semicolon in additional-methods.js (http://plugins.jquery.com/node/9233)
+* Added automatic detection of substitution parameters in messages, removing the need to provide format functions (http://plugins.jquery.com/node/11195)
+* Fixed an issue with :filled/:blank somewhat caused by Sizzle (http://plugins.jquery.com/node/11144)
+* Added an integer method to additional-methods.js (http://plugins.jquery.com/node/9612)
+* Fixed errorsFor method where the for-attribute contains characters that need escaping to be valid inside a selector (http://plugins.jquery.com/node/9611)
+
+1.5.5
+---
+* Fix for http://plugins.jquery.com/node/8659
+* Fixed trailing comma in messages_cs.js
+
+1.5.4
+---
+* Fixed remote method bug (http://plugins.jquery.com/node/8658)
+
+1.5.3
+---
+* Fixed a bug related to the wrapper-option, where all ancestor-elements that matched the wrapper-option where selected (http://plugins.jquery.com/node/7624)
+* Updated multipart demo to use latest jQuery UI accordion
+* Added dateNL and time methods to additionalMethods.js
+* Added Traditional Chinese (Taiwan, tw) and Kazakhstan (KK) localization
+* Moved jQuery.format (fomerly String.format) to jQuery.validator.format, jQuery.format is deprecated and will be removed in 1.6 (see http://code.google.com/p/jquery-utils/issues/detail?id=15 for details)
+* Cleaned up messages_pl.js and messages_ptbr.js (still defined messages for max/min/rangeValue, which were removed in 1.4)
+* Fixed flawed boolean logic in valid-plugin-method for multiple elements; now all elements need to be valid for a boolean-true result (http://plugins.jquery.com/node/8481)
+* Enhancement $.validator.addMethod: An undefined third message-argument won't overwrite an existing message (http://plugins.jquery.com/node/8443)
+* Enhancement to submitHandler option: When used, click events on submit buttons are captured and the submitting button is inserted into the form before calling submitHandler, and removed afterwards; keeps submit buttons intact (http://plugins.jquery.com/node/7183#comment-3585)
+* Added option validClass, default "valid", which adds that class to all valid elements, after validation (http://dev.jquery.com/ticket/2205)
+* Added creditcardtypes method to additionalMethods.js, including tests (via http://dev.jquery.com/ticket/3635)
+* Improved remote method to allow serverside message as a string, or true for valid, or false for invalid using the clientside defined message (http://dev.jquery.com/ticket/3807)
+* Improved accept method to also accept a Drupal-style comma-seperated list of values (http://plugins.jquery.com/node/8580)
+
+1.5.2
+---
+* Fixed messages in additional-methods.js for maxWords, minWords, and rangeWords to include call to $.format
+* Fixed value passed to methods to exclude carriage return (\r), same as jQuery's val() does
+* Added slovak (sk) localization
+* Added demo for intergration with jQuery UI tabs
+* Added selects-grouping example to tabs demo (see second tab, birthdate field)
+
+1.5.1
+---
+* Updated marketo demo to use invalidHandler option instead of binding invalid-form event
+* Added TinyMCE integration example
+* Added ukrainian (ua) localization
+* Fixed length validation to work with trimmed value (regression from 1.5 where general trimming before validation was removed)
+* Various small fixes for compability with both 1.2.6 and 1.3
+
+1.5
+---
+* Improved basic demo, validating confirm-password field after password changed
+* Fixed basic validation to pass the untrimmed input value as the first parameter to validation methods, changed required accordingly; breaks existing custom method that rely on the trimming
+* Added norwegian (no), italian (it), hungarian (hu) and romanian (ro) localization
+* Fixed #3195: Two flaws in swedish localization
+* Fixed #3503: Extended rules("add") to accept messages propery: use to specify add custom messages to an element via rules("add", { messages: { required: "Required! " } });
+* Fixed #3356: Regression from #2908 when using meta-option
+* Fixed #3370: Added ignoreTitle option, set to skip reading messages from the title attribute, helps to avoid issues with Google Toolbar; default is false for compability
+* Fixed #3516: Trigger invalid-form event even when remote validation is involved
+* Added invalidHandler option as a shortcut to bind("invalid-form", function() {})
+* Fixed Safari issue for loading indicator in ajaxSubmit-integration-demo (append to body first, then hide)
+* Added test for creditcard validation and improved default message
+* Enhanced remote validation, accepting options to passthrough to $.ajax as paramter (either url string or options, including url property plus everything else that $.ajax supports)
+
+1.4
+---
+* Fixed #2931, validate elements in document order and ignore type=image inputs
+* Fixed usage of $ and jQuery variables, now fully comptible with all variations of noConflict usage
+* Implemented #2908, enabling custom messages via metadata ala class="{required:true,messages:{required:'required field'}}", added demo/custom-messages-metadata-demo.html
+* Removed deprecated methods minValue (min), maxValue (max), rangeValue (rangevalue), minLength (minlength), maxLength (maxlength), rangeLength (rangelength)
+* Fixed #2215 regression: Call unhighlight only for current elements, not everything
+* Implemented #2989, enabling image button to cancel validation
+* Fixed issue where IE incorrectly validates against maxlength=0
+* Added czech (cs) localization
+* Reset validator.submitted on validator.resetForm(), enabling a full reset when necessary
+* Fixed #3035, skipping all falsy attributes when reading rules (0, undefined, empty string), removed part of the maxlength workaround (for 0)
+* Added dutch (nl) localization (#3201)
+
+1.3
+---
+* Fixed invalid-form event, now only triggered when form is invalid
+* Added spanish (es), russian (ru), portuguese brazilian (ptbr), turkish (tr), and polish (pl) localization
+* Added removeAttrs plugin to facilate adding and removing multiple attributes
+* Added groups option to display a single message for multiple elements, via groups: { arbitraryGroupName: "fieldName1 fieldName2[, fieldNameN" }
+* Enhanced rules() for adding and removing (static) rules: rules("add", "method1[, methodN]"/{method1:param[, method_n:param]}) and rules("remove"[, "method1[, method_n]")
+* Enhanced rules-option, accepts space-seperated string-list of methods, eg. {birthdate: "required date"}
+* Fixed checkbox group validation with inline rules: As long as the rules are specified on the first element, the group is now properly validated on click
+* Fixed #2473, ignoring all rules with an explicit parameter of boolean-false, eg. required:false is the same as not specifying required at all (it was handled as required:true so far)
+* Fixed #2424, with a modified patch from #2473: Methods returning a dependency-mismatch don't stop other rules from being evaluated anymore; still, success isn't applied for optional fields
+* Fixed url and email validation to not use trimmed values
+* Fixed creditcard validation to accept only digits and dashes ("asdf" is not a valid creditcard number)
+* Allow both button and input elements for cancel buttons (via class="cancel")
+* Fixed #2215: Fixed message display to call unhighlight as part of showing and hiding messages, no more visual side-effects while checking an element and extracted validator.checkForm to validate a form without UI sideeffects
+* Rewrote custom selectors (:blank, :filled, :unchecked) with functions for compability with AIR
+
+1.2.1
+-----
+
+* Bundled delegeate plugin with validate plugin - its always required anyway
+* Improved remote validation to include parts from the ajaxQueue plugin for proper synchronization (no additional plugin necessary)
+* Fixed stopRequest to prevent pendingRequest < 0
+* Added jQuery.validator.autoCreateRanges property, defaults to false, enable to convert min/max to range and minlength/maxlength to rangelength; this basically fixes the issue introduced by automatically creating ranges in 1.2
+* Fixed optional-methods to not highlight anything at all if the field is blank, that is, don't trigger success
+* Allow false/null for highlight/unhighlight options instead of forcing a do-nothing-callback even when nothing needs to be highlighted
+* Fixed validate() call with no elements selected, returning undefined instead of throwing an error
+* Improved demo, replacing metadata with classes/attributes for specifying rules
+* Fixed error when no custom message is used for remote validation
+* Modified email and url validation to require domain label and top label
+* Fixed url and email validation to require TLD (actually to require domain label); 1.2 version (TLD is optional) is moved to additionals as url2 and email2
+* Fixed dynamic-totals demo in IE6/7 and improved templating, using textarea to store multiline template and string interpolation
+* Added login form example with "Email password" link that makes the password field optional
+* Enhanced dynamic-totals demo with an example of a single message for two fields
+
+1.2
+---
+
+* Added AJAX-captcha validation example (based on http://psyrens.com/captcha/)
+* Added remember-the-milk-demo (thanks RTM team for the permission!)
+* Added marketo-demo (thanks Glen Lipka!)
+* Added support for ajax-validation, see method "remote"; serverside returns JSON, true for valid elements, false or a String for invalid, String is used as message
+* Added highlight and unhighlight options, by default toggles errorClass on element, allows custom highlighting
+* Added valid() plugin method for easy programmatic checking of forms and fields without the need to use the validator API
+* Added rules() plguin method to read and write rules for an element (currently read only)
+* Replaced regex for email method, thanks to the contribution by Scott Gonzalez, see http://projects.scottsplayground.com/email_address_validation/
+* Restructured event architecture to rely solely on delegation, both improving performance, and ease-of-use for the developer (requires jquery.delegate.js)
+* Moved documentation from inline to http://docs.jquery.com/Plugins/Validation - including interactive examples for all methods
+* Removed validator.refresh(), validation is now completey dynamic
+* Renamed minValue to min, maxValue to max and rangeValue to range, deprecating the previous names (to be removed in 1.3)
+* Renamed minLength to minlength, maxLength to maxlength and rangeLength to rangelength, deprecating the previous names (to be removed in 1.3)
+* Added feature to merge min + max into and range and minlength + maxlength into rangelength
+* Added support for dynamic rule parameters, allowing to specify a function as a parameter eg. for minlength, called when validating the element
+* Allow to specify null or an empty string as a message to display nothing (see marketo demo)
+* Rules overhaul: Now supports combination of rules-option, metadata, classes (new) and attributes (new), see rules() for details
+
+1.1.2
+---
+
+* Replaced regex for URL method, thanks to the contribution by Scott Gonzalez, see http://projects.scottsplayground.com/iri/
+* Improved email method to better handle unicode characters
+* Fixed error container to hide when all elements are valid, not only on form submit
+* Fixed String.format to jQuery.format (moving into jQuery namespace)
+* Fixed accept method to accept both upper and lowercase extensions
+* Fixed validate() plugin method to create only one validator instance for a given form and always return that one instance (avoids binding events multiple times)
+* Changed debug-mode console log from "error" to "warn" level
+
+1.1.1
+-----
+
+* Fixed invalid XHTML, preventing error label creation in IE since jQuery 1.1.4
+* Fixed and improved String.format: Global search & replace, better handling of array arguments
+* Fixed cancel-button handling to use validator-object for storing state instead of form element
+* Fixed name selectors to handle "complex" names, eg. containing brackets ("list[]")
+* Added button and disabled elements to exclude from validation
+* Moved element event handlers to refresh to be able to add handlers to new elements
+* Fixed email validation to allow long top level domains (eg. ".travel")
+* Moved showErrors() from valid() to form()
+* Added validator.size(): returns the number of current errors
+* Call submitHandler with validator as scope for easier access of it's methods, eg. to find error labels using errorsFor(Element)
+* Compatible with jQuery 1.1.x and 1.2.x
+
+1.1
+---
+
+* Added validation on blur, keyup and click (for checkboxes and radiobutton). Replaces event-option.
+* Fixed resetForm
+* Fixed custom-methods-demo
+
+1.0
+---
+
+* Improved number and numberDE methods to check for correct decimal numbers with delimiters
+* Only elements that have rules are checked (otherwise success-option is applied to all elements)
+* Added creditcard number method (thanks to Brian Klug)
+* Added ignore-option, eg. ignore: "[@type=hidden]", using that expression to exclude elements to validate. Default: none, though submit and reset buttons are always ignored
+* Heavily enhanced Functions-as-messages by providing a flexible String.format helper
+* Accept Functions as messages, providing runtime-custom-messages
+* Fixed exclusion of elements without rules from successList
+* Fixed custom-method-demo, replaced the alert with message displaying the number of errors
+* Fixed form-submit-prevention when using submitHandler
+* Completely removed dependency on element IDs, though they are still used (when present) to link error labels to inputs. Achieved by using
+ an array with {name, message, element} instead of an object with id:message pairs for the internal errorList.
+* Added support for specifying simple rules as simple strings, eg. "required" is equivalent to {required: true}
+* Added feature: Add errorClass to invalid field�s parent element, making it easy to style the label/field container or the label for the field.
+* Added feature: focusCleanup - If enabled, removes the errorClass from the invalid elements and hides all errors messages whenever the element is focused.
+* Added success option to show the a field was validated successfully
+* Fixed Opera select-issue (avoiding a attribute-collision)
+* Fixed problems with focussing hidden elements in IE
+* Added feature to skip validation for submit buttons with class "cancel"
+* Fixed potential issues with Google Toolbar by prefering plugin option messages over title attribute
+* submitHandler is only called when an actual submit event was handled, validator.form() returns false only for invalid forms
+* Invalid elements are now focused only on submit or via validator.focusInvalid(), avoiding all trouble with focus-on-blur
+* IE6 error container layout issue is solved
+* Customize error element via errorElement option
+* Added validator.refresh() to find new inputs in the form
+* Added accept validation method, checks file extensions
+* Improved dependecy feature by adding two custom expressions: ":blank" to select elements with an empty value and �:filled� to select elements with a value, both excluding whitespace
+* Added a resetForm() method to the validator: Resets each form element (using the form plugin, if available), removes classes on invalid elements and hides all error messages
+* Fixed docs for validator.showErrors()
+* Fixed error label creation to always use html() instead of text(), allowing arbitrary HTML passed in as messages
+* Fixed error label creation to use specified error class
+* Added dependency feature: The requires method accepts both String (jQuery expressions) and Functions as the argument
+* Heavily improved customizing of error message display: Use normal messages and show/hide an additional container; Completely replace message display with own mechanism (while being able to delegate to the default handler; Customize placing of generated labels (instead of default below-element)
+* Fixed two major bugs in IE (error containers) and Opera (metadata)
+* Modified validation methods to accept empty fields as valid (exception: of course �required� and also �equalTo� methods)
+* Renamed "min" to "minLength", "max" to "maxLength", "length" to "rangeLength"
+* Added "minValue", "maxValue" and "rangeValue"
+* Streamlined API for support of different events. The default, submit, can be disabled. If any event is specified, that is applied to each element (instead of the entire form). Combining keyup-validation with submit-validation is now extremely easy to setup
+* Added support for one-message-per-rule when defining messages via plugin settings
+* Added support to wrap metadata in some parent element. Useful when metadata is used for other plugins, too.
+* Refactored tests and demos: Less files, better demos
* Improved documentation: More examples for methods, more reference texts explaining some basics
54 demo/captcha/captcha.js
View
@@ -1,27 +1,27 @@
-$(function(){
- $("#refreshimg").click(function(){
- $.post('newsession.php');
- $("#captchaimage").load('image_req.php');
- return false;
- });
-
- $("#captchaform").validate({
- rules: {
- captcha: {
- required: true,
- remote: "process.php"
- }
- },
- messages: {
- captcha: "Correct captcha is required. Click the captcha to generate a new one"
- },
- submitHandler: function() {
- alert("Correct captcha!");
- },
- success: function(label) {
- label.addClass("valid").text("Valid captcha!")
- },
- onkeyup: false
- });
-
-});
+$(function(){
+ $("#refreshimg").click(function(){
+ $.post('newsession.php');
+ $("#captchaimage").load('image_req.php');
+ return false;
+ });
+
+ $("#captchaform").validate({
+ rules: {
+ captcha: {
+ required: true,
+ remote: "process.php"
+ }
+ },
+ messages: {
+ captcha: "Correct captcha is required. Click the captcha to generate a new one"
+ },
+ submitHandler: function() {
+ alert("Correct captcha!");
+ },
+ success: function(label) {
+ label.addClass("valid").text("Valid captcha!")
+ },
+ onkeyup: false
+ });
+
+});
10 demo/captcha/image_req.php
View
@@ -1,6 +1,6 @@
-<?php
-
-// Echo the image - timestamp appended to prevent caching
-echo '<a href="index.php" onclick="refreshimg(); return false;" title="Click to refresh image"><img src="images/image.jpg?' . time() . '" width="132" height="46" alt="Captcha image" /></a>';
-
+<?php
+
+// Echo the image - timestamp appended to prevent caching
+echo '<a href="index.php" onclick="refreshimg(); return false;" title="Click to refresh image"><img src="images/image.jpg?' . time() . '" width="132" height="46" alt="Captcha image" /></a>';
+
?>
130 demo/captcha/index.php
View
@@ -1,66 +1,66 @@
-<?php
-
-// Make the page validate
-ini_set('session.use_trans_sid', '0');
-
-// Include the random string file
-require 'rand.php';
-
-// Begin the session
-session_start();
-
-// Set the session contents
-$_SESSION['captcha_id'] = $str;
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <title>AJAX CAPTCHA</title>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <meta name="keywords" content="AJAX,JHR,PHP,CAPTCHA,download,PHP CAPTCHA,AJAX CAPTCHA,AJAX PHP CAPTCHA,download AJAX CAPTCHA,download AJAX PHP CAPTCHA" />
- <meta name="description" content="An AJAX CAPTCHA script, written in PHP" />
-
- <script type="text/javascript" src="../../lib/jquery.js"></script>
- <script type="text/javascript" src="../../jquery.validate.js"></script>
- <script type="text/javascript" src="captcha.js"></script>
-
- <link rel="stylesheet" type="text/css" href="style.css" />
- <style type="text/css">
- img { border: 1px solid #eee; }
- p#statusgreen { font-size: 1.2em; background-color: #fff; color: #0a0; }
- p#statusred { font-size: 1.2em; background-color: #fff; color: #a00; }
- fieldset label { display: block; }
- fieldset div#captchaimage { float: left; margin-right: 15px; }
- fieldset input#captcha { width: 25%; border: 1px solid #ddd; padding: 2px; }
- fieldset input#submit { display: block; margin: 2% 0% 0% 0%; }
- #captcha.success {
- border: 1px solid #49c24f;
- background: #bcffbf;
- }
- #captcha.error {
- border: 1px solid #c24949;
- background: #ffbcbc;
- }
- </style>
-</head>
-
-<body>
-
-<h1><acronym title="Asynchronous JavaScript And XML">AJAX</acronym> <acronym title="Completely Automated Public Turing test to tell Computers and Humans Apart">CAPTCHA</acronym>, based on <a href="http://psyrens.com/captcha/">http://psyrens.com/captcha/</a></h1>
-
-<form id="captchaform" action="">
-<fieldset>
- <div id="captchaimage"><a href="<?php echo $_SERVER['PHP_SELF']; ?>" id="refreshimg" title="Click to refresh image"><img src="images/image.php?<?php echo time(); ?>" width="132" height="46" alt="Captcha image" /></a></div>
- <label for="captcha">Enter the characters as seen on the image above (case insensitive):</label>
- <input type="text" maxlength="6" name="captcha" id="captcha" />
- <input type="submit" name="submit" id="submit" value="Check" />
-</fieldset>
-</form>
-
-<p>If you can&#39;t decipher the text on the image, click it to dynamically generate a new one.</p>
-
-</body>
-
+<?php
+
+// Make the page validate
+ini_set('session.use_trans_sid', '0');
+
+// Include the random string file
+require 'rand.php';
+
+// Begin the session
+session_start();
+
+// Set the session contents
+$_SESSION['captcha_id'] = $str;
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <title>AJAX CAPTCHA</title>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <meta name="keywords" content="AJAX,JHR,PHP,CAPTCHA,download,PHP CAPTCHA,AJAX CAPTCHA,AJAX PHP CAPTCHA,download AJAX CAPTCHA,download AJAX PHP CAPTCHA" />
+ <meta name="description" content="An AJAX CAPTCHA script, written in PHP" />
+
+ <script type="text/javascript" src="../../lib/jquery.js"></script>
+ <script type="text/javascript" src="../../jquery.validate.js"></script>
+ <script type="text/javascript" src="captcha.js"></script>
+
+ <link rel="stylesheet" type="text/css" href="style.css" />
+ <style type="text/css">
+ img { border: 1px solid #eee; }
+ p#statusgreen { font-size: 1.2em; background-color: #fff; color: #0a0; }
+ p#statusred { font-size: 1.2em; background-color: #fff; color: #a00; }
+ fieldset label { display: block; }
+ fieldset div#captchaimage { float: left; margin-right: 15px; }
+ fieldset input#captcha { width: 25%; border: 1px solid #ddd; padding: 2px; }
+ fieldset input#submit { display: block; margin: 2% 0% 0% 0%; }
+ #captcha.success {
+ border: 1px solid #49c24f;
+ background: #bcffbf;
+ }
+ #captcha.error {
+ border: 1px solid #c24949;
+ background: #ffbcbc;
+ }
+ </style>
+</head>
+
+<body>
+
+<h1><acronym title="Asynchronous JavaScript And XML">AJAX</acronym> <acronym title="Completely Automated Public Turing test to tell Computers and Humans Apart">CAPTCHA</acronym>, based on <a href="http://psyrens.com/captcha/">http://psyrens.com/captcha/</a></h1>
+
+<form id="captchaform" action="">
+<fieldset>
+ <div id="captchaimage"><a href="<?php echo $_SERVER['PHP_SELF']; ?>" id="refreshimg" title="Click to refresh image"><img src="images/image.php?<?php echo time(); ?>" width="132" height="46" alt="Captcha image" /></a></div>
+ <label for="captcha">Enter the characters as seen on the image above (case insensitive):</label>
+ <input type="text" maxlength="6" name="captcha" id="captcha" />
+ <input type="submit" name="submit" id="submit" value="Check" />
+</fieldset>
+</form>
+
+<p>If you can&#39;t decipher the text on the image, click it to dynamically generate a new one.</p>
+
+</body>
+
</html>
22 demo/captcha/newsession.php
View
@@ -1,12 +1,12 @@
-<?php
-
-// Include the random string file
-require 'rand.php';
-
-// Begin a new session
-session_start();
-
-// Set the session contents
-$_SESSION['captcha_id'] = $str;
-
+<?php
+
+// Include the random string file
+require 'rand.php';
+
+// Begin a new session
+session_start();
+
+// Set the session contents
+$_SESSION['captcha_id'] = $str;
+
?>
26 demo/captcha/process.php
View
@@ -1,14 +1,14 @@
-<?php
-
-// Begin the session
-session_start();
-
-// To avoid case conflicts, make the input uppercase and check against the session value
-// If it's correct, echo '1' as a string
-if(strtoupper($_GET['captcha']) == $_SESSION['captcha_id'])
- echo 'true';
-// Else echo '0' as a string
-else
- echo 'false';
-
+<?php
+
+// Begin the session
+session_start();
+
+// To avoid case conflicts, make the input uppercase and check against the session value
+// If it's correct, echo '1' as a string
+if(strtoupper($_GET['captcha']) == $_SESSION['captcha_id'])
+ echo 'true';
+// Else echo '0' as a string
+else
+ echo 'false';
+
?>
20 demo/captcha/rand.php
View
@@ -1,11 +1,11 @@
-<?php
-
-// Create a random string, leaving out 'o' to avoid confusion with '0'
-$char = strtoupper(substr(str_shuffle('abcdefghjkmnpqrstuvwxyz'), 0, 4));
-
-// Concatenate the random string onto the random numbers
-// The font 'Anorexia' doesn't have a character for '8', so the numbers will only go up to 7
-// '0' is left out to avoid confusion with 'O'
-$str = rand(1, 7) . rand(1, 7) . $char;
-
+<?php
+
+// Create a random string, leaving out 'o' to avoid confusion with '0'
+$char = strtoupper(substr(str_shuffle('abcdefghjkmnpqrstuvwxyz'), 0, 4));
+
+// Concatenate the random string onto the random numbers
+// The font 'Anorexia' doesn't have a character for '8', so the numbers will only go up to 7
+// '0' is left out to avoid confusion with 'O'
+$str = rand(1, 7) . rand(1, 7) . $char;
+
?>
20 demo/captcha/style.css
View
@@ -113,14 +113,14 @@ p#statusred {
fieldset label {
display: block;
-}
-
-fieldset label.error {
- color: red;
-}
-
-fieldset label.valid {
- color: green;
+}
+
+fieldset label.error {
+ color: red;
+}
+
+fieldset label.valid {
+ color: green;
}
fieldset div#captchaimage {
@@ -132,8 +132,8 @@ fieldset input#captcha {
width: 25%;
border: 1px solid #ddd;
padding: 2px;
-}
-
+}
+
fieldset input#submit {
display: block;
margin: 2% 0% 0% 0%;
80 demo/css/cmxform.css
View
@@ -1,46 +1,46 @@
-/**********************************
-
-Name: cmxform Styles
-
-***********************************/
-form.cmxform {
- width: 370px;
- font-size: 1.0em;
- color: #333;
-}
-
-form.cmxform legend {
- padding-left: 0;
-}
-
-form.cmxform legend, form.cmxform label {
- color: #333;
-}
-
-form.cmxform fieldset {
- border: none;
- border-top: 1px solid #C9DCA6;
- background: url(../images/cmxform-fieldset.gif) left bottom repeat-x;
- background-color: #F8FDEF;
-}
-
-form.cmxform fieldset fieldset {
- background: none;
-}
-
-form.cmxform fieldset p, form.cmxform fieldset fieldset {
- padding: 5px 10px 7px;
- background: url(../images/cmxform-divider.gif) left bottom repeat-x;
-}
-
+/**********************************
+
+Name: cmxform Styles
+
+***********************************/
+form.cmxform {
+ width: 370px;
+ font-size: 1.0em;
+ color: #333;
+}
+
+form.cmxform legend {
+ padding-left: 0;
+}
+
+form.cmxform legend, form.cmxform label {
+ color: #333;
+}
+
+form.cmxform fieldset {
+ border: none;
+ border-top: 1px solid #C9DCA6;
+ background: url(../images/cmxform-fieldset.gif) left bottom repeat-x;
+ background-color: #F8FDEF;
+}
+
+form.cmxform fieldset fieldset {
+ background: none;
+}
+
+form.cmxform fieldset p, form.cmxform fieldset fieldset {
+ padding: 5px 10px 7px;
+ background: url(../images/cmxform-divider.gif) left bottom repeat-x;
+}
+
form.cmxform label.error, label.error {
- /* remove the next line when you have trouble in IE6 with labels in list */
- color: red;
- font-style: italic
+ /* remove the next line when you have trouble in IE6 with labels in list */
+ color: red;
+ font-style: italic
}
div.error { display: none; }
-input { border: 1px solid black; }
+input { border: 1px solid black; }
input.checkbox { border: none }
input:focus { border: 1px dotted black; }
-input.error { border: 1px dotted red; }
+input.error { border: 1px dotted red; }
form.cmxform .gray * { color: gray; }
108 demo/css/cmxformTemplate.css
View
@@ -1,55 +1,55 @@
-/**********************************
-
-Use: cmxform template
-
-***********************************/
-form.cmxform fieldset {
- margin-bottom: 10px;
-}
-
-form.cmxform legend {
- padding: 0 2px;
- font-weight: bold;
- _margin: 0 -7px; /* IE Win */
-}
-
-form.cmxform label {
- display: inline-block;
- line-height: 1.8;
- vertical-align: top;
- cursor: hand;
-}
-
-form.cmxform fieldset p {
- list-style: none;
- padding: 5px;
- margin: 0;
-}
-
-form.cmxform fieldset fieldset {
- border: none;
- margin: 3px 0 0;
-}
-
-form.cmxform fieldset fieldset legend {
- padding: 0 0 5px;
- font-weight: normal;
-}
-
-form.cmxform fieldset fieldset label {
- display: block;
- width: auto;
-}
-
-form.cmxform label { width: 100px; } /* Width of labels */
-form.cmxform fieldset fieldset label { margin-left: 103px; } /* Width plus 3 (html space) */
-form.cmxform label.error {
- margin-left: 103px;
- width: 220px;
-}
-
-form.cmxform input.submit {
- margin-left: 103px;
-}
-
+/**********************************
+
+Use: cmxform template
+
+***********************************/
+form.cmxform fieldset {
+ margin-bottom: 10px;
+}
+
+form.cmxform legend {
+ padding: 0 2px;
+ font-weight: bold;
+ _margin: 0 -7px; /* IE Win */
+}
+
+form.cmxform label {
+ display: inline-block;
+ line-height: 1.8;
+ vertical-align: top;
+ cursor: hand;
+}
+
+form.cmxform fieldset p {
+ list-style: none;
+ padding: 5px;
+ margin: 0;
+}
+
+form.cmxform fieldset fieldset {
+ border: none;
+ margin: 3px 0 0;
+}
+
+form.cmxform fieldset fieldset legend {
+ padding: 0 0 5px;
+ font-weight: normal;
+}
+
+form.cmxform fieldset fieldset label {
+ display: block;
+ width: auto;
+}
+
+form.cmxform label { width: 100px; } /* Width of labels */
+form.cmxform fieldset fieldset label { margin-left: 103px; } /* Width plus 3 (html space) */
+form.cmxform label.error {
+ margin-left: 103px;
+ width: 220px;
+}
+
+form.cmxform input.submit {
+ margin-left: 103px;
+}
+
/*\*//*/ form.cmxform legend { display: inline-block; } /* IE Mac legend fix */
26 demo/css/core.css
View
@@ -1,16 +1,16 @@
-body, div { font-family: 'lucida grande', helvetica, verdana, arial, sans-serif }
-body { margin: 0; padding: 0; font-size: small; color: #333 }
-h1, h2 { font-family: 'trebuchet ms', verdana, arial; padding: 10px; margin: 0 }
-h1 { font-size: large }
-#main { padding: 1em; }
-#banner { padding: 15px; background-color: #06b; color: white; font-size: large; border-bottom: 1px solid #ccc;
- background: url(../images/bg.gif) repeat-x; text-align: center }
-#banner a { color: white; }
-
-p { margin: 10px 0; }
-
-li { margin-left: 10px; }
-
+body, div { font-family: 'lucida grande', helvetica, verdana, arial, sans-serif }
+body { margin: 0; padding: 0; font-size: small; color: #333 }
+h1, h2 { font-family: 'trebuchet ms', verdana, arial; padding: 10px; margin: 0 }
+h1 { font-size: large }
+#main { padding: 1em; }
+#banner { padding: 15px; background-color: #06b; color: white; font-size: large; border-bottom: 1px solid #ccc;
+ background: url(../images/bg.gif) repeat-x; text-align: center }
+#banner a { color: white; }
+
+p { margin: 10px 0; }
+
+li { margin-left: 10px; }
+
h3 { margin: 1em 0 0; }
h1 { font-size: 2em; }
120 demo/css/reset.css
View
@@ -1,61 +1,61 @@
-/**********************************
-
-Use: Reset Styles for all browsers
-
-***********************************/
-
-body, p, blockquote {
- margin: 0;
- padding: 0;
-}
-
-a img, iframe { border: none; }
-
-/* Headers
-------------------------------*/
-
-h1, h2, h3, h4, h5, h6 {
- margin: 0;
- padding: 0;
- font-size: 100%;
-}
-
-/* Lists
-------------------------------*/
-
-ul, ol, dl, li, dt, dd {
- margin: 0;
- padding: 0;
-}
-
-/* Links
-------------------------------*/
-
-a, a:link {}
-a:visited {}
-a:hover {}
-a:active {}
-
-/* Forms
-------------------------------*/
-
-form, fieldset {
- margin: 0;
- padding: 0;
-}
-
-fieldset { border: 1px solid #000; }
-
-legend {
- padding: 0;
- color: #000;
-}
-
-input, textarea, select {
- margin: 0;
- padding: 1px;
- font-size: 100%;
- font-family: inherit;
-}
-
+/**********************************
+
+Use: Reset Styles for all browsers
+
+***********************************/
+
+body, p, blockquote {
+ margin: 0;
+ padding: 0;
+}
+
+a img, iframe { border: none; }
+
+/* Headers
+------------------------------*/
+
+h1, h2, h3, h4, h5, h6 {
+ margin: 0;
+ padding: 0;
+ font-size: 100%;
+}
+
+/* Lists
+------------------------------*/
+
+ul, ol, dl, li, dt, dd {
+ margin: 0;
+ padding: 0;
+}
+
+/* Links
+------------------------------*/
+
+a, a:link {}
+a:visited {}
+a:hover {}
+a:active {}
+
+/* Forms
+------------------------------*/
+
+form, fieldset {
+ margin: 0;
+ padding: 0;
+}
+
+fieldset { border: 1px solid #000; }
+
+legend {
+ padding: 0;
+ color: #000;
+}
+
+input, textarea, select {
+ margin: 0;
+ padding: 1px;
+ font-size: 100%;
+ font-family: inherit;
+}
+
select { padding: 0; }
20 demo/css/screen.css
View
@@ -1,11 +1,11 @@
-/**********************************
-
-Use: Main Screen Import
-
-***********************************/
-
-@import "reset.css";
-@import "core.css";
-
-@import "cmxformTemplate.css";
+/**********************************
+
+Use: Main Screen Import
+
+***********************************/
+
+@import "reset.css";
+@import "core.css";
+
+@import "cmxformTemplate.css";
@import "cmxform.css";
182 demo/custom-messages-metadata-demo.html
View
@@ -1,92 +1,92 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>jQuery validation plug-in - comment form example</title>
-
-<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
-
-<script src="../lib/jquery.js" type="text/javascript"></script>
-<script src="../jquery.validate.js" type="text/javascript"></script>
-<script src="../lib/jquery.metadata.js" type="text/javascript"></script>
-
-<script type="text/javascript">
-$(document).ready(function() {
- $("#commentForm").validate({meta: "validate"});
- $("#commentForm2").validate();
- $("#commentForm3").validate({
- messages: {
- email: {
- required: 'Enter this!'
- }
- }
- });
-
-});
-</script>
-
-<style type="text/css">
-form { width: 500px; }
-form label { width: 250px; }
-form label.error,
-form input.submit { margin-left: 253px; }
-</style>
-
-</head>
-<body>
-
-<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
-<div id="main">
-
-<p>Take a look at the source to see how messages can be customized with metadata.</p>
-
-<!-- Custom messages with custom "meta" setting -->
-<form class="cmxform" id="commentForm" method="post" action="">
- <fieldset>
- <legend>Please enter your email address</legend>
- <p>
-
- <label for="cemail">E-Mail *</label>
- <input id="cemail" name="email" class="{validate:{required:true, email:true, messages:{required:'Please enter your email address', email:'Please enter a valid email address'}}}"/>
- </p>
- <p>
- <input class="submit" type="submit" value="Submit"/>
- </p>
- </fieldset>
-</form>
-<!-- Custom messages with default "meta" setting -->
-<form class="cmxform" id="commentForm2" method="post" action="">
- <fieldset>
- <legend>Please enter your email address</legend>
- <p>
-
- <label for="cemail">E-Mail *</label>
- <input id="cemail" name="email" class="{required:true, email:true, messages:{required:'Please enter your email address', email:'Please enter a valid email address'}}"/>
- </p>
- <p>
- <input class="submit" type="submit" value="Submit"/>
- </p>
- </fieldset>
-</form>
-<!-- Custom message for "required" in metadata is overriden by a validate option -->
-<form class="cmxform" id="commentForm3" method="post" action="">
- <fieldset>
- <legend>Please enter your email address</legend>
- <p>
-
- <label for="cemail">E-Mail *</label>
- <input id="cemail" name="email" class="{required:true, email:true, messages:{email:'Please enter a valid email address'}}"/>
- </p>
- <p>
- <input class="submit" type="submit" value="Submit"/>
- </p>
- </fieldset>
-</form>
-
-<a href="index.html">Back to main page</a>
-
-<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
-<script type="text/javascript">_uacct = "UA-2623402-1";urchinTracker();</script>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>jQuery validation plug-in - comment form example</title>
+
+<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
+
+<script src="../lib/jquery.js" type="text/javascript"></script>
+<script src="../jquery.validate.js" type="text/javascript"></script>
+<script src="../lib/jquery.metadata.js" type="text/javascript"></script>
+
+<script type="text/javascript">
+$(document).ready(function() {
+ $("#commentForm").validate({meta: "validate"});
+ $("#commentForm2").validate();
+ $("#commentForm3").validate({
+ messages: {
+ email: {
+ required: 'Enter this!'
+ }
+ }
+ });
+
+});
+</script>
+
+<style type="text/css">
+form { width: 500px; }
+form label { width: 250px; }
+form label.error,
+form input.submit { margin-left: 253px; }
+</style>
+
+</head>
+<body>
+
+<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
+<div id="main">
+
+<p>Take a look at the source to see how messages can be customized with metadata.</p>
+
+<!-- Custom messages with custom "meta" setting -->
+<form class="cmxform" id="commentForm" method="post" action="">
+ <fieldset>
+ <legend>Please enter your email address</legend>
+ <p>
+
+ <label for="cemail">E-Mail *</label>
+ <input id="cemail" name="email" class="{validate:{required:true, email:true, messages:{required:'Please enter your email address', email:'Please enter a valid email address'}}}"/>
+ </p>
+ <p>
+ <input class="submit" type="submit" value="Submit"/>
+ </p>
+ </fieldset>
+</form>
+<!-- Custom messages with default "meta" setting -->
+<form class="cmxform" id="commentForm2" method="post" action="">
+ <fieldset>
+ <legend>Please enter your email address</legend>
+ <p>
+
+ <label for="cemail">E-Mail *</label>
+ <input id="cemail" name="email" class="{required:true, email:true, messages:{required:'Please enter your email address', email:'Please enter a valid email address'}}"/>
+ </p>
+ <p>
+ <input class="submit" type="submit" value="Submit"/>
+ </p>
+ </fieldset>
+</form>
+<!-- Custom message for "required" in metadata is overriden by a validate option -->
+<form class="cmxform" id="commentForm3" method="post" action="">
+ <fieldset>
+ <legend>Please enter your email address</legend>
+ <p>
+
+ <label for="cemail">E-Mail *</label>
+ <input id="cemail" name="email" class="{required:true, email:true, messages:{email:'Please enter a valid email address'}}"/>
+ </p>
+ <p>
+ <input class="submit" type="submit" value="Submit"/>
+ </p>
+ </fieldset>
+</form>
+
+<a href="index.html">Back to main page</a>
+
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
+<script type="text/javascript">_uacct = "UA-2623402-1";urchinTracker();</script>
+
+</body>
</html>
4 demo/custom-methods-demo.html
View
@@ -24,8 +24,8 @@
};
$().ready(function() {
- var validator = $("#texttests").bind("invalid-form.validate", function() {
- $("#summary").html("Your form contains " + validator.numberOfInvalids() + " errors, see details below.");
+ var validator = $("#texttests").bind("invalid-form.validate", function() {
+ $("#summary").html("Your form contains " + validator.numberOfInvalids() + " errors, see details below.");
}).validate({
debug: true,
errorElement: "em",
110 demo/dynamic-totals.html
View
@@ -9,40 +9,40 @@
<script src="../lib/jquery.js" type="text/javascript"></script>
<script src="../jquery.validate.js" type="text/javascript"></script>
-
+
<script type="text/javascript">
// only for demo purposes
$.validator.setDefaults({
submitHandler: function() {
alert("submitted!");
}
-});
+});
$.validator.messages.max = jQuery.format("Your totals musn't exceed {0}!");
$.validator.addMethod("quantity", function(value, element) {
return !this.optional(element) && !this.optional($(element).parent().prev().children("select")[0]);
}, "Please select both the item and its amount.");
-
-$().ready(function() {
+
+$().ready(function() {
$("#orderform").validate({
- errorPlacement: function(error, element) {
- error.appendTo( element.parent().next() );
+ errorPlacement: function(error, element) {
+ error.appendTo( element.parent().next() );
},
highlight: function(element, errorClass) {
$(element).addClass(errorClass).parent().prev().children("select").addClass(errorClass);
- }
+ }
});
- var template = jQuery.format($("#template").val());
+ var template = jQuery.format($("#template").val());
function addRow() {
$(template(i++)).appendTo("#orderitems tbody");
}
- var i = 1;
+ var i = 1;
// start with one row
- addRow();
- // add more rows on click
- $("#add").click(addRow);
+ addRow();
+ // add more rows on click
+ $("#add").click(addRow);
// check keyup on quantity inputs to update totals field
$("#orderform").delegate("keyup", "input.quantity", function(event) {
@@ -52,10 +52,10 @@
});
$("#totals").attr("value", totals).valid();
});
-
-});
-</script>
-
+
+});
+</script>
+
<style type="text/css">
form.cmxform { width: 50em; }
em.error {
@@ -66,32 +66,32 @@
background:url("images/checked.gif") no-repeat 0px 0px;
padding-left: 16px;
}
-
-form.cmxform label.error {
- margin-left: auto;
- width: 250px;
-}
-form.cmxform input.submit {
- margin-left: 0;
+
+form.cmxform label.error {
+ margin-left: auto;
+ width: 250px;
+}
+form.cmxform input.submit {
+ margin-left: 0;
}
-em.error { color: black; }
+em.error { color: black; }
#warning { display: none; }
select.error {
border: 1px dotted red;
-}
-</style>
+}
+</style>
</head>
-<body>
-
-<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
-<div id="main">
-
-<textarea style="display:none" id="template">
- <tr>
- <td>
- <label>{0}. Item</label>
- </td>
+<body>
+
+<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
+<div id="main">
+
+<textarea style="display:none" id="template">
+ <tr>
+ <td>
+ <label>{0}. Item</label>
+ </td>
<td class='type'>
<select name="item-type-{0}">
<option value="">Select...</option>
@@ -101,19 +101,19 @@ <h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-vali
<option vlaue="3">jQuery In Action</option>
<option value="4">jQuery For Designers</option>
</select>
- </td>
- <td class='quantity'>
- <input size='4' class="quantity" min="1" id="item-quantity-{0}" name="item-quantity-{0}" />
</td>
- <td class='quantity-error'></td>
- </tr>
-</textarea>
+ <td class='quantity'>
+ <input size='4' class="quantity" min="1" id="item-quantity-{0}" name="item-quantity-{0}" />
+ </td>
+ <td class='quantity-error'></td>
+ </tr>
+</textarea>
-<form id="orderform" class="cmxform" method="get" action="foo.html">
+<form id="orderform" class="cmxform" method="get" action="foo.html">
<h2 id="summary"></h2>
- <fieldset>
- <legend>Example with custom methods and heavily customized error display</legend>
+ <fieldset>
+ <legend>Example with custom methods and heavily customized error display</legend>
<table id="orderitems">
<tbody>
@@ -124,22 +124,22 @@ <h2 id="summary"></h2>
<td class="totals"><input id="totals" name="totals" value="0" max="25" readonly="readonly" size='4' /></td>
<td class="totals-error"></td>
</tr>
- <tr>
- <td colspan="2">&nbsp;</td>
- <td><input class="submit" type="submit" value="Submit"/></td>
+ <tr>
+ <td colspan="2">&nbsp;</td>
+ <td><input class="submit" type="submit" value="Submit"/></td>
</tr>
- </tfoot>
+ </tfoot>
</table>
- </fieldset>
+ </fieldset>
</form>
-<button id="add">Add another input to the form</button>
-
+<button id="add">Add another input to the form</button>
+
<h1 id="warning">Your form contains tons of errors! Please try again.</h1>
-<p><a href="index.html">Back to main page</a></p>
-
-</div>
+<p><a href="index.html">Back to main page</a></p>
+
+</div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
14 demo/index.html
View
@@ -204,13 +204,13 @@ <h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-vali
<li><a href="custom-methods-demo.html">Custom methods and message display.</a></li>
<li><a href="dynamic-totals.html">Dynamic forms</a></li>
<li><a href="themerollered.html">Forms styled with jQuery UI Themeroller</a></li>
-</ul>
-<h3>Real-world examples</h3>
-<ul>
- <li><a href="milk/">Remember The Milk signup form</a></li>
- <li><a href="marketo/">Marketo signup form</a></li>
- <li><a href="multipart/">Buy and Sell a House multipart form</a></li>
- <li><a href="captcha/">Remote captcha validation</a></li>
+</ul>
+<h3>Real-world examples</h3>
+<ul>
+ <li><a href="milk/">Remember The Milk signup form</a></li>
+ <li><a href="marketo/">Marketo signup form</a></li>
+ <li><a href="multipart/">Buy and Sell a House multipart form</a></li>
+ <li><a href="captcha/">Remote captcha validation</a></li>
</ul>
<h3>Testsuite</h3>
2  demo/js/chili-1.7.pack.js
View
@@ -1 +1 @@
-eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('8={3b:"1.6",2o:"1B.1Y,1B.23,1B.2e",2i:"",2H:1a,12:"",2C:1a,Z:"",2a:\'<H V="$0">$$</H>\',R:"&#F;",1j:"&#F;&#F;&#F;&#F;",1f:"&#F;<1W/>",3c:5(){9 $(y).39("1k")[0]},I:{},N:{}};(5($){$(5(){5 1J(l,a){5 2I(A,h){4 3=(1v h.3=="1h")?h.3:h.3.1w;k.1m({A:A,3:"("+3+")",u:1+(3.c(/\\\\./g,"%").c(/\\[.*?\\]/g,"%").3a(/\\((?!\\?)/g)||[]).u,z:(h.z)?h.z:8.2a})}5 2z(){4 1E=0;4 1x=x 2A;Q(4 i=0;i<k.u;i++){4 3=k[i].3;3=3.c(/\\\\\\\\|\\\\(\\d+)/g,5(m,1F){9!1F?m:"\\\\"+(1E+1+1t(1F))});1x.1m(3);1E+=k[i].u}4 1w=1x.3d("|");9 x 1u(1w,(a.3g)?"2j":"g")}5 1S(o){9 o.c(/&/g,"&3h;").c(/</g,"&3e;")}5 1R(o){9 o.c(/ +/g,5(1X){9 1X.c(/ /g,R)})}5 G(o){o=1S(o);7(R){o=1R(o)}9 o}5 2m(2E){4 i=0;4 j=1;4 h;19(h=k[i++]){4 1b=D;7(1b[j]){4 1U=/(\\\\\\$)|(?:\\$\\$)|(?:\\$(\\d+))/g;4 z=h.z.c(1U,5(m,1V,K){4 3f=\'\';7(1V){9"$"}v 7(!K){9 G(1b[j])}v 7(K=="0"){9 h.A}v{9 G(1b[j+1t(K,10)])}});4 1A=D[D.u-2];4 2h=D[D.u-1];4 2G=2h.2v(11,1A);11=1A+2E.u;14+=G(2G)+z;9 z}v{j+=h.u}}}4 R=8.R;4 k=x 2A;Q(4 A 2r a.k){2I(A,a.k[A])}4 14="";4 11=0;l.c(2z(),2m);4 2y=l.2v(11,l.u);14+=G(2y);9 14}5 2B(X){7(!8.N[X]){4 Y=\'<Y 32="1p" 33="p/2u"\'+\' 30="\'+X+\'">\';8.N[X]=1H;7($.31.34){4 W=J.1L(Y);4 $W=$(W);$("2d").1O($W)}v{$("2d").1O(Y)}}}5 1q(e,a){4 l=e&&e.1g&&e.1g[0]&&e.1g[0].37;7(!l)l="";l=l.c(/\\r\\n?/g,"\\n");4 C=1J(l,a);7(8.1j){C=C.c(/\\t/g,8.1j)}7(8.1f){C=C.c(/\\n/g,8.1f)}$(e).38(C)}5 1o(q,13){4 1l={12:8.12,2x:q+".1d",Z:8.Z,2w:q+".2u"};4 B;7(13&&1v 13=="2l")B=$.35(1l,13);v B=1l;9{a:B.12+B.2x,1p:B.Z+B.2w}}7($.2q)$.2q({36:"2l.15"});4 2n=x 1u("\\\\b"+8.2i+"\\\\b","2j");4 1e=[];$(8.2o).2D(5(){4 e=y;4 1n=$(e).3i("V");7(!1n){9}4 q=$.3u(1n.c(2n,""));7(\'\'!=q){1e.1m(e);4 f=1o(q,e.15);7(8.2H||e.15){7(!8.N[f.a]){1D{8.N[f.a]=1H;$.3v(f.a,5(M){M.f=f.a;8.I[f.a]=M;7(8.2C){2B(f.1p)}$("."+q).2D(5(){4 f=1o(q,y.15);7(M.f==f.a){1q(y,M)}})})}1I(3s){3t("a 3w Q: "+q+\'@\'+3z)}}}v{4 a=8.I[f.a];7(a){1q(e,a)}}}});7(J.1i&&J.1i.29){5 22(p){7(\'\'==p){9""}1z{4 16=(x 3A()).2k()}19(p.3x(16)>-1);p=p.c(/\\<1W[^>]*?\\>/3y,16);4 e=J.1L(\'<1k>\');e.3l=p;p=e.3m.c(x 1u(16,"g"),\'\\r\\n\');9 p}4 T="";4 18=1G;$(1e).3j().G("1k").U("2c",5(){18=y}).U("1M",5(){7(18==y)T=J.1i.29().3k});$("3n").U("3q",5(){7(\'\'!=T){2p.3r.3o(\'3p\',22(T));2V.2R=1a}}).U("2c",5(){T=""}).U("1M",5(){18=1G})}})})(1Z);8.I["1Y.1d"]={k:{2M:{3:/\\/\\*[^*]*\\*+(?:[^\\/][^*]*\\*+)*\\//},25:{3:/\\<!--(?:.|\\n)*?--\\>/},2f:{3:/\\/\\/.*/},2P:{3:/2L|2T|2J|2O|2N|2X|2K|2Z|2U|2S|2W|2Y|2Q|51|c-50/},53:{3:/\\/[^\\/\\\\\\n]*(?:\\\\.[^\\/\\\\\\n]*)*\\/[52]*/},1h:{3:/(?:\\\'[^\\\'\\\\\\n]*(?:\\\\.[^\\\'\\\\\\n]*)*\\\')|(?:\\"[^\\"\\\\\\n]*(?:\\\\.[^\\"\\\\\\n]*)*\\")/},27:{3:/\\b[+-]?(?:\\d*\\.?\\d+|\\d+\\.?\\d*)(?:[1r][+-]?\\d+)?\\b/},4X:{3:/\\b(D|1N|1K|1I|2t|2s|4W|1z|v|1a|Q|5|7|2r|4Z|x|1G|9|1Q|y|1H|1D|1v|4|4Y|19|59)\\b/},1y:{3:/\\b(58|2k|2p|5b|5a|55|J|54|57|1t|56|4L|4K|4N|4M|4H|4G|4J)\\b/},1C:{3:/(?:\\<\\w+)|(?:\\>)|(?:\\<\\/\\w+\\>)|(?:\\/\\>)/},26:{3:/\\s+\\w+(?=\\s*=)/},20:{3:/([\\"\\\'])(?:(?:[^\\1\\\\\\r\\n]*?(?:\\1\\1|\\\\.))*[^\\1\\\\\\r\\n]*?)\\1/},21:{3:/&[\\w#]+?;/},4I:{3:/(\\$|1Z)/}}};8.I["23.1d"]={k:{25:{3:/\\<!--(?:.|\\n)*?--\\>/},1h:{3:/(?:\\\'[^\\\'\\\\\\n]*(?:\\\\.[^\\\'\\\\\\n]*)*\\\')|(?:\\"[^\\"\\\\\\n]*(?:\\\\.[^\\"\\\\\\n]*)*\\")/},27:{3:/\\b[+-]?(?:\\d*\\.?\\d+|\\d+\\.?\\d*)(?:[1r][+-]?\\d+)?\\b/},1C:{3:/(?:\\<\\w+)|(?:\\>)|(?:\\<\\/\\w+\\>)|(?:\\/\\>)/},26:{3:/\\s+\\w+(?=\\s*=)/},20:{3:/([\\"\\\'])(?:(?:[^\\1\\\\\\r\\n]*?(?:\\1\\1|\\\\.))*[^\\1\\\\\\r\\n]*?)\\1/},21:{3:/&[\\w#]+?;/}}};8.I["2e.1d"]={k:{4S:{3:/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//},2f:{3:/(?:\\/\\/.*)|(?:[^\\\\]\\#.*)/},4V:{3:/\\\'[^\\\'\\\\]*(?:\\\\.[^\\\'\\\\]*)*\\\'/},4U:{3:/\\"[^\\"\\\\]*(?:\\\\.[^\\"\\\\]*)*\\"/},4P:{3:/\\b(?:[4O][2b][1s][1s]|[4R][4Q][2b][1P]|[5c][5v][1s][5u][1P])\\b/},5x:{3:/\\b[+-]?(\\d*\\.?\\d+|\\d+\\.?\\d*)([1r][+-]?\\d+)?\\b/},5y:{3:/\\b(?:5z|5w(?:5A|5E(?:5F(?:17|1c)|5G(?:17|1c))|17|1T|5B|5C|5D(?:17|1T|1c)|1c)|P(?:5h(?:5k|5j)|5e(?:5d|5g(?:5f|5l)|5r|E(?:5t|5s)|5n(?:5m|5p)|L(?:3X|3W)|O(?:S|3Y(?:3T|3S|3V))|3U|S(?:44|47|46)|41))|40)\\b/},1y:{3:/(?:\\$43|\\$42|\\$3R|\\$3G|\\$3F|\\$3I|\\$3H|\\$3C|\\$3B|\\$3D)\\b/},28:{3:/\\b(?:3O|3N|3P|3K|3J|3M|3L|48|4v|1N|1K|1I|4u|V|4x|4w|2t|4r|2s|4q|1z|4t|v|4s|4D|4C|4F|4E|4z|4y|4B|4A|4p|4d|2F|2F|4g|Q|4f|5|1y|7|4a|4m|4l|4o|4i|4k|x|4j|4h|4n|4b|4c|49|4e|3Q|3E|9|45|1Q|y|3Z|1D|5o|5q|4|19|5i)\\b/},2g:{3:/\\$(\\w+)/,z:\'<H V="28">$</H><H V="2g">$1</H>\'},1C:{3:/(?:\\<\\?[24][4T][24])|(?:\\<\\?)|(?:\\?\\>)/}}}',62,353,'|||exp|var|function||if|ChiliBook|return|recipe||replace||el|path||step|||steps|ingredients|||str|text|recipeName||||length|else||new|this|replacement|stepName|settings|dish|arguments||160|filter|span|recipes|document|||recipeLoaded|required|||for|replaceSpace||insidePRE|bind|class|domLink|stylesheetPath|link|stylesheetFolder||lastIndex|recipeFolder|options|perfect|chili|newline|ERROR|downPRE|while|false|aux|WARNING|js|codes|replaceNewLine|childNodes|string|selection|replaceTab|pre|settingsDef|push|elClass|getPath|stylesheet|makeDish|eE|Ll|parseInt|RegExp|typeof|source|exps|global|do|offset|code|tag|try|prevLength|aNum|null|true|catch|cook|case|createElement|mouseup|break|append|Ee|switch|replaceSpaces|escapeHTML|NOTICE|pattern|escaped|br|spaces|mix|jQuery|avalue|entity|preformatted|xml|Pp|htcom|aname|numbers|keyword|createRange|defaultReplacement|Uu|mousedown|head|php|com|variable|input|elementClass|gi|valueOf|object|chef|selectClass|elementPath|window|metaobjects|in|default|continue|css|substring|stylesheetFile|recipeFile|lastUnmatched|knowHow|Array|checkCSS|stylesheetLoading|each|matched|extends|unmatched|recipeLoading|prepareStep|unblockUI|ajaxSubmit|silverlight|jscom|unblock|block|plugin|clearFields|returnValue|fieldValue|blockUI|formSerialize|event|resetForm|ajaxForm|clearForm|fieldSerialize|href|browser|rel|type|msie|extend|selector|data|html|next|match|version|getPRE|join|lt|bit|ignoreCase|amp|attr|parents|htmlText|innerHTML|innerText|body|setData|Text|copy|clipboardData|recipeNotAvailable|alert|trim|getJSON|unavailable|indexOf|ig|recipePath|Date|_SESSION|_SERVER|php_errormsg|require_once|_GET|_FILES|_REQUEST|_POST|__METHOD__|__LINE__|and|abstract|__FILE__|__CLASS__|__FUNCTION__|require|_ENV|END|CONT|PREFIX|START|OCALSTATEDIR|IBDIR|UTPUT_HANDLER_|throw|__COMPILER_HALT_OFFSET__|VERSION|_COOKIE|GLOBALS|API|static|YSCONFDIR|HLIB_SUFFIX|array|protected|implements|print|private|exit|public|foreach|final|or|isset|old_function|list|include_once|include|php_user_filter|interface|exception|die|declare|elseif|echo|cfunction|as|const|clone|endswitch|endif|eval|endwhile|enddeclare|empty|endforeach|endfor|isNaN|NaN|jquery|Infinity|clearTimeout|setTimeout|clearInterval|setInterval|Nn|value|Rr|Tt|mlcom|Hh|string2|string1|delete|keywords|void|instanceof|content|taconite|gim|regexp|escape|constructor|parseFloat|unescape|toString|with|prototype|element|Ff|BINDIR|HP_|PATH|CONFIG_FILE_|EAR_|xor|INSTALL_DIR|EXTENSION_DIR|SCAN_DIR|MAX|INT_|unset|SIZE|use|DATADIR|XTENSION_DIR|OL|Ss|Aa|E_|number|const1|DEFAULT_INCLUDE_PATH|ALL|PARSE|STRICT|USER_|CO|MPILE_|RE_'.split('|'),0,{}))
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('8={3b:"1.6",2o:"1B.1Y,1B.23,1B.2e",2i:"",2H:1a,12:"",2C:1a,Z:"",2a:\'<H V="$0">$$</H>\',R:"&#F;",1j:"&#F;&#F;&#F;&#F;",1f:"&#F;<1W/>",3c:5(){9 $(y).39("1k")[0]},I:{},N:{}};(5($){$(5(){5 1J(l,a){5 2I(A,h){4 3=(1v h.3=="1h")?h.3:h.3.1w;k.1m({A:A,3:"("+3+")",u:1+(3.c(/\\\\./g,"%").c(/\\[.*?\\]/g,"%").3a(/\\((?!\\?)/g)||[]).u,z:(h.z)?h.z:8.2a})}5 2z(){4 1E=0;4 1x=x 2A;Q(4 i=0;i<k.u;i++){4 3=k[i].3;3=3.c(/\\\\\\\\|\\\\(\\d+)/g,5(m,1F){9!1F?m:"\\\\"+(1E+1+1t(1F))});1x.1m(3);1E+=k[i].u}4 1w=1x.3d("|");9 x 1u(1w,(a.3g)?"2j":"g")}5 1S(o){9 o.c(/&/g,"&3h;").c(/</g,"&3e;")}5 1R(o){9 o.c(/ +/g,5(1X){9 1X.c(/ /g,R)})}5 G(o){o=1S(o);7(R){o=1R(o)}9 o}5 2m(2E){4 i=0;4 j=1;4 h;19(h=k[i++]){4 1b=D;7(1b[j]){4 1U=/(\\\\\\$)|(?:\\$\\$)|(?:\\$(\\d+))/g;4 z=h.z.c(1U,5(m,1V,K){4 3f=\'\';7(1V){9"$"}v 7(!K){9 G(1b[j])}v 7(K=="0"){9 h.A}v{9 G(1b[j+1t(K,10)])}});4 1A=D[D.u-2];4 2h=D[D.u-1];4 2G=2h.2v(11,1A);11=1A+2E.u;14+=G(2G)+z;9 z}v{j+=h.u}}}4 R=8.R;4 k=x 2A;Q(4 A 2r a.k){2I(A,a.k[A])}4 14="";4 11=0;l.c(2z(),2m);4 2y=l.2v(11,l.u);14+=G(2y);9 14}5 2B(X){7(!8.N[X]){4 Y=\'<Y 32="1p" 33="p/2u"\'+\' 30="\'+X+\'">\';8.N[X]=1H;7($.31.34){4 W=J.1L(Y);4 $W=$(W);$("2d").1O($W)}v{$("2d").1O(Y)}}}5 1q(e,a){4 l=e&&e.1g&&e.1g[0]&&e.1g[0].37;7(!l)l="";l=l.c(/\\r\\n?/g,"\\n");4 C=1J(l,a);7(8.1j){C=C.c(/\\t/g,8.1j)}7(8.1f){C=C.c(/\\n/g,8.1f)}$(e).38(C)}5 1o(q,13){4 1l={12:8.12,2x:q+".1d",Z:8.Z,2w:q+".2u"};4 B;7(13&&1v 13=="2l")B=$.35(1l,13);v B=1l;9{a:B.12+B.2x,1p:B.Z+B.2w}}7($.2q)$.2q({36:"2l.15"});4 2n=x 1u("\\\\b"+8.2i+"\\\\b","2j");4 1e=[];$(8.2o).2D(5(){4 e=y;4 1n=$(e).3i("V");7(!1n){9}4 q=$.3u(1n.c(2n,""));7(\'\'!=q){1e.1m(e);4 f=1o(q,e.15);7(8.2H||e.15){7(!8.N[f.a]){1D{8.N[f.a]=1H;$.3v(f.a,5(M){M.f=f.a;8.I[f.a]=M;7(8.2C){2B(f.1p)}$("."+q).2D(5(){4 f=1o(q,y.15);7(M.f==f.a){1q(y,M)}})})}1I(3s){3t("a 3w Q: "+q+\'@\'+3z)}}}v{4 a=8.I[f.a];7(a){1q(e,a)}}}});7(J.1i&&J.1i.29){5 22(p){7(\'\'==p){9""}1z{4 16=(x 3A()).2k()}19(p.3x(16)>-1);p=p.c(/\\<1W[^>]*?\\>/3y,16);4 e=J.1L(\'<1k>\');e.3l=p;p=e.3m.c(x 1u(16,"g"),\'\\r\\n\');9 p}4 T="";4 18=1G;$(1e).3j().G("1k").U("2c",5(){18=y}).U("1M",5(){7(18==y)T=J.1i.29().3k});$("3n").U("3q",5(){7(\'\'!=T){2p.3r.3o(\'3p\',22(T));2V.2R=1a}}).U("2c",5(){T=""}).U("1M",5(){18=1G})}})})(1Z);8.I["1Y.1d"]={k:{2M:{3:/\\/\\*[^*]*\\*+(?:[^\\/][^*]*\\*+)*\\//},25:{3:/\\<!--(?:.|\\n)*?--\\>/},2f:{3:/\\/\\/.*/},2P:{3:/2L|2T|2J|2O|2N|2X|2K|2Z|2U|2S|2W|2Y|2Q|51|c-50/},53:{3:/\\/[^\\/\\\\\\n]*(?:\\\\.[^\\/\\\\\\n]*)*\\/[52]*/},1h:{3:/(?:\\\'[^\\\'\\\\\\n]*(?:\\\\.[^\\\'\\\\\\n]*)*\\\')|(?:\\"[^\\"\\\\\\n]*(?:\\\\.[^\\"\\\\\\n]*)*\\")/},27:{3:/\\b[+-]?(?:\\d*\\.?\\d+|\\d+\\.?\\d*)(?:[1r][+-]?\\d+)?\\b/},4X:{3:/\\b(D|1N|1K|1I|2t|2s|4W|1z|v|1a|Q|5|7|2r|4Z|x|1G|9|1Q|y|1H|1D|1v|4|4Y|19|59)\\b/},1y:{3:/\\b(58|2k|2p|5b|5a|55|J|54|57|1t|56|4L|4K|4N|4M|4H|4G|4J)\\b/},1C:{3:/(?:\\<\\w+)|(?:\\>)|(?:\\<\\/\\w+\\>)|(?:\\/\\>)/},26:{3:/\\s+\\w+(?=\\s*=)/},20:{3:/([\\"\\\'])(?:(?:[^\\1\\\\\\r\\n]*?(?:\\1\\1|\\\\.))*[^\\1\\\\\\r\\n]*?)\\1/},21:{3:/&[\\w#]+?;/},4I:{3:/(\\$|1Z)/}}};8.I["23.1d"]={k:{25:{3:/\\<!--(?:.|\\n)*?--\\>/},1h:{3:/(?:\\\'[^\\\'\\\\\\n]*(?:\\\\.[^\\\'\\\\\\n]*)*\\\')|(?:\\"[^\\"\\\\\\n]*(?:\\\\.[^\\"\\\\\\n]*)*\\")/},27:{3:/\\b[+-]?(?:\\d*\\.?\\d+|\\d+\\.?\\d*)(?:[1r][+-]?\\d+)?\\b/},1C:{3:/(?:\\<\\w+)|(?:\\>)|(?:\\<\\/\\w+\\>)|(?:\\/\\>)/},26:{3:/\\s+\\w+(?=\\s*=)/},20:{3:/([\\"\\\'])(?:(?:[^\\1\\\\\\r\\n]*?(?:\\1\\1|\\\\.))*[^\\1\\\\\\r\\n]*?)\\1/},21:{3:/&[\\w#]+?;/}}};8.I["2e.1d"]={k:{4S:{3:/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//},2f:{3:/(?:\\/\\/.*)|(?:[^\\\\]\\#.*)/},4V:{3:/\\\'[^\\\'\\\\]*(?:\\\\.[^\\\'\\\\]*)*\\\'/},4U:{3:/\\"[^\\"\\\\]*(?:\\\\.[^\\"\\\\]*)*\\"/},4P:{3:/\\b(?:[4O][2b][1s][1s]|[4R][4Q][2b][1P]|[5c][5v][1s][5u][1P])\\b/},5x:{3:/\\b[+-]?(\\d*\\.?\\d+|\\d+\\.?\\d*)([1r][+-]?\\d+)?\\b/},5y:{3:/\\b(?:5z|5w(?:5A|5E(?:5F(?:17|1c)|5G(?:17|1c))|17|1T|5B|5C|5D(?:17|1T|1c)|1c)|P(?:5h(?:5k|5j)|5e(?:5d|5g(?:5f|5l)|5r|E(?:5t|5s)|5n(?:5m|5p)|L(?:3X|3W)|O(?:S|3Y(?:3T|3S|3V))|3U|S(?:44|47|46)|41))|40)\\b/},1y:{3:/(?:\\$43|\\$42|\\$3R|\\$3G|\\$3F|\\$3I|\\$3H|\\$3C|\\$3B|\\$3D)\\b/},28:{3:/\\b(?:3O|3N|3P|3K|3J|3M|3L|48|4v|1N|1K|1I|4u|V|4x|4w|2t|4r|2s|4q|1z|4t|v|4s|4D|4C|4F|4E|4z|4y|4B|4A|4p|4d|2F|2F|4g|Q|4f|5|1y|7|4a|4m|4l|4o|4i|4k|x|4j|4h|4n|4b|4c|49|4e|3Q|3E|9|45|1Q|y|3Z|1D|5o|5q|4|19|5i)\\b/},2g:{3:/\\$(\\w+)/,z:\'<H V="28">$</H><H V="2g">$1</H>\'},1C:{3:/(?:\\<\\?[24][4T][24])|(?:\\<\\?)|(?:\\?\\>)/}}}',62,353,'|||exp|var|function||if|ChiliBook|return|recipe||replace||el|path||step|||steps|ingredients|||str|text|recipeName||||length|else||new|this|replacement|stepName|settings|dish|arguments||160|filter|span|recipes|document|||recipeLoaded|required|||for|replaceSpace||insidePRE|bind|class|domLink|stylesheetPath|link|stylesheetFolder||lastIndex|recipeFolder|options|perfect|chili|newline|ERROR|downPRE|while|false|aux|WARNING|js|codes|replaceNewLine|childNodes|string|selection|replaceTab|pre|settingsDef|push|elClass|getPath|stylesheet|makeDish|eE|Ll|parseInt|RegExp|typeof|source|exps|global|do|offset|code|tag|try|prevLength|aNum|null|true|catch|cook|case|createElement|mouseup|break|append|Ee|switch|replaceSpaces|escapeHTML|NOTICE|pattern|escaped|br|spaces|mix|jQuery|avalue|entity|preformatted|xml|Pp|htcom|aname|numbers|keyword|createRange|defaultReplacement|Uu|mousedown|head|php|com|variable|input|elementClass|gi|valueOf|object|chef|selectClass|elementPath|window|metaobjects|in|default|continue|css|substring|stylesheetFile|recipeFile|lastUnmatched|knowHow|Array|checkCSS|stylesheetLoading|each|matched|extends|unmatched|recipeLoading|prepareStep|unblockUI|ajaxSubmit|silverlight|jscom|unblock|block|plugin|clearFields|returnValue|fieldValue|blockUI|formSerialize|event|resetForm|ajaxForm|clearForm|fieldSerialize|href|browser|rel|type|msie|extend|selector|data|html|next|match|version|getPRE|join|lt|bit|ignoreCase|amp|attr|parents|htmlText|innerHTML|innerText|body|setData|Text|copy|clipboardData|recipeNotAvailable|alert|trim|getJSON|unavailable|indexOf|ig|recipePath|Date|_SESSION|_SERVER|php_errormsg|require_once|_GET|_FILES|_REQUEST|_POST|__METHOD__|__LINE__|and|abstract|__FILE__|__CLASS__|__FUNCTION__|require|_ENV|END|CONT|PREFIX|START|OCALSTATEDIR|IBDIR|UTPUT_HANDLER_|throw|__COMPILER_HALT_OFFSET__|VERSION|_COOKIE|GLOBALS|API|static|YSCONFDIR|HLIB_SUFFIX|array|protected|implements|print|private|exit|public|foreach|final|or|isset|old_function|list|include_once|include|php_user_filter|interface|exception|die|declare|elseif|echo|cfunction|as|const|clone|endswitch|endif|eval|endwhile|enddeclare|empty|endforeach|endfor|isNaN|NaN|jquery|Infinity|clearTimeout|setTimeout|clearInterval|setInterval|Nn|value|Rr|Tt|mlcom|Hh|string2|string1|delete|keywords|void|instanceof|content|taconite|gim|regexp|escape|constructor|parseFloat|unescape|toString|with|prototype|element|Ff|BINDIR|HP_|PATH|CONFIG_FILE_|EAR_|xor|INSTALL_DIR|EXTENSION_DIR|SCAN_DIR|MAX|INT_|unset|SIZE|use|DATADIR|XTENSION_DIR|OL|Ss|Aa|E_|number|const1|DEFAULT_INCLUDE_PATH|ALL|PARSE|STRICT|USER_|CO|MPILE_|RE_'.split('|'),0,{}))
18 demo/marketo/emails.php
View
<
@@ -1,10 +1,10 @@
-<?php
-$request = trim(strtolower($_REQUEST['email']));
-$emails = array('glen@marketo.com', 'george@bush.gov', 'me@god.com', 'aboutface@cooper.com', 'steam@valve.com', 'bill@gates.com');
-$valid = 'true';
-foreach($emails as $email) {
- if( strtolower($email) == $request )
- $valid = 'false';
-}
-echo $valid;
+<?php
+$request = trim(strtolower($_REQUEST['email']));