-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated jquery validate plugin (dist files only)
Cleanup of validation script. Refactor into template to allow customisation of validation. Explicitly set error element to 'span' as per new jquery-validate support [ref: CWPBUG-110]
- Loading branch information
Damian Mooyman
committed
May 21, 2014
1 parent
7a77cfb
commit 5e0b7fd
Showing
245 changed files
with
3,056 additions
and
56,263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
<?php | ||
|
||
if(!defined('USERFORMS_DIR')) { | ||
define('USERFORMS_DIR', basename(__DIR__)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
(function($) { | ||
$(document).ready(function() { | ||
$("#Form_Form").validate({ | ||
ignore: ':hidden', | ||
errorClass: "required", | ||
errorElement: "span", | ||
errorPlacement: function(error, element) { | ||
error.addClass('message') | ||
if(element.is(":radio")) { | ||
error.insertAfter(element.closest("ul")); | ||
} else { | ||
error.insertAfter(element); | ||
} | ||
}, | ||
messages: { | ||
<% loop $Fields %> | ||
<% if $ErrorMessage && not $SetsOwnError %> | ||
'{$Name.JS}': '{$ErrorMessage.JS}', | ||
<% end_if %> | ||
<% end_loop %> | ||
}, | ||
rules: { | ||
<% loop $Fields %> | ||
<% if $Validation %> | ||
'{$Name.JS}': {$ValidationJSON.RAW}, | ||
<% end_if %> | ||
<% end_loop %> | ||
}, | ||
<% if $EnableLiveValidation %> | ||
// Enable live validation | ||
onfocusout : function(element) { this.element(element); } | ||
<% end_if %> | ||
}); | ||
<% if $HideFieldLabels %> | ||
// Hide field labels (use HTML5 placeholder instead) | ||
$("#Form_Form label.left").each(function() { | ||
$("#"+$(this).attr("for")) | ||
.attr("placeholder", $(this).text()); | ||
$(this).remove(); | ||
}); | ||
Placeholders.init(); | ||
<% end_if %> | ||
}); | ||
})(jQuery); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.