function trim(s){return s.replace(/^\s+|\s+$/g,'')} function formValidation(o) { var valid=true; var errors = []; for ( var i=0, l=o.length - 2; i o[i].maxlength ) locValid=false; if ( ! locValid ) { valid = false; o[i].style.backgroundColor = '#fee'; } } if( ! valid ) { errors.push( "Fields required".localize() ); } if ( o[2].value != o[3].value ) { valid=false; errors.push( "Mismatch with mail confirmation".localize() ); o[3].style.backgroundColor = '#fee'; } if ( valid ) { var args = []; for ( var i=0, l=o.length; i'); } return false; } function updateCounting(o) { var counting = document.getElementById('customerCounting'); counting.innerHTML = "%0 caracter(s) from 300".localize().replace('%0', o.value.length); }