Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncheck a checkbox in ComponentView

Tags:

Im trying to uncheck a checkbox in the ComponentView of Tridion by jquery using the document ready event in a GUI extension:

$j(document).ready(function(){
    alert("is loaded");
    var field = $j('[type=checkbox][value=Aceptar]')
    field.attr("checked",false);
    console.log("field = " + field.is(':checked'));
    alert("is checked field = " + field.is(':checked'));
}); 

The problem is that on "$j(document).ready" the field values don't seem to be loaded in the ComponentView. My alert returns that the field is unchecked, but when the view finishes loading the checkbox is checked.It seems that the "$j(document).ready" fires before the values are loaded. Does anybody know which event I should use?