I just copied the translated text (with one or two minor adjustments) and placed them into the file mooValidation.js. if you paste the following test over the last function: Validation.addAllThese{[ rigth up until the last bracket (I know it is not the correct way...) and save it (try backing up your English file?) you get a nice Dutch translation. Works nicely, Max, could you check it if it is okay like this? I might have broken something without knowing. (for example: I had to change the "komma's" to "een komma" because the ' broke the script in half).
On another note, Where could I find the CSS code that formats the warings? I would like to give them a bit more... warning-ish feel to them. I hardly see them now, blue on blue.
[code]Validation.addAllThese([
['required', 'Dit is een verplicht veld.', function(v) {
return !Validation.get('IsEmpty').test(v);
}],
['validate-number', 'Vul in dit veld alstublieft een geldig nummer in.', function(v) {
return Validation.get('IsEmpty').test(v) || (!isNaN(v) && !/^\s+$/.test(v));
}],
['validate-digits', 'Gebruik in dit veld alstublieft alleen nummers, voorkom spaties of andere karakters zoals een punt of komma.', function(v) {
return Validation.get('IsEmpty').test(v) || !/[^\d]/.test(v);
}],
['validate-alpha', 'Gebruik in dit veld alstublieft alleen letters (a-z) in.', function (v) {
return Validation.get('IsEmpty').test(v) || /^[a-zA-Z]+$/.test(v)
}],
['validate-alphanum', 'Gebruik in dit veld alstublieft alleen letters (a-z) of nummers (0-9). Spaties of andere karakters zijn niet toegestaan.', function(v) {
return Validation.get('IsEmpty').test(v) || !/\W/.test(v)
}],
['validate-date', 'Vul in dit veld alstublieft een geldige datum in.', function(v) {
var test = new Date(v);
return Validation.get('IsEmpty').test(v) || !isNaN(test);
}],
['validate-email', 'Vul in dit veld alstublieft een geldig email adres in. Bijvoorbeeld fred@domein.nl', function (v) {
return Validation.get('IsEmpty').test(v) || /\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(v)
}],
['validate-url', 'Vul alstublieft een geldig webadres in.', function (v) {
return Validation.get('IsEmpty').test(v) || /^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(v)
}],
['validate-date-au', 'Gebruik alstublieft de volgende datum notatie: dd/mm/yyyy. Bijvoorbeeld 17/03/2006 voor 17 Maart 2006', function(v) {
if(Validation.get('IsEmpty').test(v)) return true;
var regex = /^(\d{2})\/(\d{2})\/(\d{4})$/;
if(!regex.test(v)) return false;
var d = new Date(v.replace(regex, '$2/$1/$3'));
return ( parseInt(RegExp.$2, 10) == (1+d.getMonth()) ) &&
(parseInt(RegExp.$1, 10) == d.getDate()) &&
(parseInt(RegExp.$3, 10) == d.getFullYear() );
}],
['validate-currency-dollar', 'Vul alstublieft een geldig € bedrag in. Bijvoorbeeld €100.00', function(v) {
// [$]1[##][,###]+[.##]
// [$]1###+[.##]
// [$]0.##
// [$].##
return Validation.get('IsEmpty').test(v) || /^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/.test(v)
}],
['validate-selection', 'Maak hier alstublieft een keuze.', function(v,elm){
return elm.options ? elm.selectedIndex > 0 : !Validation.get('IsEmpty').test(v);
}],
['validate-one-required', 'Kies alstublieft een van de bovenstaande opties.', function (v,elm) {
var p = elm.parentNode;
var options = p.getElementsByTagName('INPUT');
for(i=0; i<options.length; i++){
if(options[i].checked == true) {
return true;
}
}
}]
]);[/code]