How to translate required form in html 5 osclass

How to translate required form in html 5 osclass

  1. Editing oc-content/ themes/ rival/ item-post.php ( if you use other theme, just replace rival with your theme )
  2. Replace this code

 

 

$("#catId").attr("required", true);
$("#countryId").attr("required", true);
$("#regionId").attr("required", true);
$("#cityId").attr("required", true);

replace with this code

$("#catId").attr("required", true);
$("#countryId").attr("required", true);
$("#regionId").attr("required", true);
$("#cityId").attr("required", true);
document.getElementById("catId").oninvalid = function () {
this.setCustomValidity(this.value ? '' : 'My message');
};
document.getElementById("countryId").oninvalid = function () {
this.setCustomValidity(this.value ? '' : 'My message 2');
};
document.getElementById("regionId").oninvalid = function () {
this.setCustomValidity(this.value ? '' : 'My message 3');
};
document.getElementById("cityId").oninvalid = function () {
this.setCustomValidity(this.value ? '' : 'My message 4');
};
document.getElementById("boxmes").oninvalid = function () {
this.setCustomValidity(this.checked ? '' : 'My message 5');
};

save your changes, don’t forget to replace my messages 1,2,3,4 with your word

Top