Hi! Quick update! I did sove it. Did not use the right id´s
$(document).ready(function() {
removeValidator("termsofuse_1");
$("#termsofuse_1").parent().prev().removeClass('required');
// Add event validator
if (typeof(Page_Validators) == 'undefined') return;
// Create new validator
var newValidator = document.createElement('span');
newValidator.style.display = "none";
newValidator.id = "termsofuseValidator";
newValidator.controltovalidate = "termsofuse_1";
newValidator.errormessage = "<a href='#termsofuse_label'>Bitte akzeptieren Sie die Nutzungsbediengungen.</a>";
newValidator.evaluationfunction = function() {
if($("#termsofuse_1").is(':checked'))
{
return true;
}
else
{
if ($('#termsofuse_1').val() == "1") {
return false;
} else {
return true;
}
}
};
Page_Validators.push(newValidator);
})
function removeValidator(fieldName) {
var count = 0;
for(var i =0; i < Page_Validators.length - count; i++){
if (Page_Validators[i - count].id == "RequiredFieldValidator" + fieldName) {
Page_Validators.splice(i - count, 1);
count++;
}
}
$("#" + fieldName + "_label").parent().removeClass("required");
}
Thanks!