function check() { checkForLabel("page:in_panel", "page:in"); checkForLabel("page:textarea_panel", "page:textarea"); checkForLabel("page:time_panel", "page:time"); checkForLabel("page:date_panel", "page:date"); checkForLabel("page:check_panel", "page:check"); checkForLabel("page:mcheck_panel", "page:mcheck"); checkForLabel("page:mlist_panel", "page:mlist"); checkForLabel("page:shuttle_panel", "page:shuttle"); checkForLabel("page:choice_panel", "page:choice"); checkForLabel("page:list_panel", "page:list"); checkForLabel("page:radio_panel", "page:radio"); checkForLabel("page:file_panel", "page:file"); checkForLabel("page:tc_in_panel", "page:tc_in"); } function checkForLabel(labelId, componentId) { var label = jQuery(Tobago.Utils.escapeClientId(labelId)).children("label"); var component = jQuery(Tobago.Utils.escapeClientId(componentId)); if (label.size() != 1) { LOG.error("Label not found with id: '" + labelId + "'"); } if (component.size() != 1) { LOG.error("Component not found with id: '" + componentId + "'"); } if (label.attr('for') != component.attr('id')) { LOG.error("Missing for attribute for component with id: '" + componentId + "'"); } }