{literal}
<script type="text/javascript" >
cj(function($) {
+ var messages = {{/literal}
+ required: "{ts escape='js'}This field is required.{/ts}",
+ remote: "{ts escape='js'}Please fix this field.{/ts}",
+ email: "{ts escape='js'}Please enter a valid email address.{/ts}",
+ url: "{ts escape='js'}Please enter a valid URL.{/ts}",
+ date: "{ts escape='js'}Please enter a valid date.{/ts}",
+ dateISO: "{ts escape='js'}Please enter a valid date (YYYY-MM-DD).{/ts}",
+ number: "{ts escape='js'}Please enter a valid number.{/ts}",
+ digits: "{ts escape='js'}Please enter only digits.{/ts}",
+ creditcard: "{ts escape='js'}Please enter a valid credit card number.{/ts}",
+ equalTo: "{ts escape='js'}Please enter the same value again.{/ts}",
+ accept: "{ts escape='js'}Please enter a value with a valid extension.{/ts}",
+ maxlength: $.validator.format("{ts escape='js'}Please enter no more than {ldelim}0{rdelim} characters.{/ts}"),
+ minlength: $.validator.format("{ts escape='js'}Please enter at least {ldelim}0{rdelim} characters.{/ts}"),
+ rangelength: $.validator.format("{ts escape='js'}Please enter a value between {ldelim}0{rdelim} and {ldelim}1{rdelim} characters long.{/ts}"),
+ range: $.validator.format("{ts escape='js'}Please enter a value between {ldelim}0{rdelim} and {ldelim}1{rdelim}.{/ts}"),
+ max: $.validator.format("{ts escape='js'}Please enter a value less than or equal to {ldelim}0{rdelim}.{/ts}"),
+ min: $.validator.format("{ts escape='js'}Please enter a value greater than or equal to {ldelim}0{rdelim}.{/ts}")
+ {literal}};
+
var params = {
'errorClass': 'crm-inline-error',
- messages: {{/literal}
- required: "{ts escape='js'}This field is required.{/ts}",
- remote: "{ts escape='js'}Please fix this field.{/ts}",
- email: "{ts escape='js'}Please enter a valid email address.{/ts}",
- url: "{ts escape='js'}Please enter a valid URL.{/ts}",
- date: "{ts escape='js'}Please enter a valid date.{/ts}",
- dateISO: "{ts escape='js'}Please enter a valid date (YYYY-MM-DD).{/ts}",
- number: "{ts escape='js'}Please enter a valid number.{/ts}",
- digits: "{ts escape='js'}Please enter only digits.{/ts}",
- creditcard: "{ts escape='js'}Please enter a valid credit card number.{/ts}",
- equalTo: "{ts escape='js'}Please enter the same value again.{/ts}",
- accept: "{ts escape='js'}Please enter a value with a valid extension.{/ts}",
- maxlength: $.validator.format("{ts escape='js'}Please enter no more than {ldelim}0{rdelim} characters.{/ts}"),
- minlength: $.validator.format("{ts escape='js'}Please enter at least {ldelim}0{rdelim} characters.{/ts}"),
- rangelength: $.validator.format("{ts escape='js'}Please enter a value between {ldelim}0{rdelim} and {ldelim}1{rdelim} characters long.{/ts}"),
- range: $.validator.format("{ts escape='js'}Please enter a value between {ldelim}0{rdelim} and {ldelim}1{rdelim}.{/ts}"),
- max: $.validator.format("{ts escape='js'}Please enter a value less than or equal to {ldelim}0{rdelim}.{/ts}"),
- min: $.validator.format("{ts escape='js'}Please enter a value greater than or equal to {ldelim}0{rdelim}.{/ts}")
- {literal}}
+ messages: {}
};
// use civicrm notifications when there are errors
CRM.validate.params = CRM.validate.params || {};
$.extend(CRM.validate.params, params);
- $.extend($.validator.messages, CRM.validate.params.messages);
+ $.extend($.validator.messages, messages);
{/literal}
{if $form && $form.formName}