Skip to content

Commit

Permalink
add feature to highligh form comoponents if they have duplicate id.
Browse files Browse the repository at this point in the history
  • Loading branch information
wildone committed Jul 15, 2024
1 parent c4e722e commit e9b0a55
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,21 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {};
var initData = ns.getData($component, componentConfig);
ns.loadData($component, initData, componentConfig);
}

//highlight fields with same ids
const isEditMode = $("body").hasClass("isEditMode");

if (isEditMode) {
$("form [id]").each( function () {
const fieldId = $(this).attr("id");
const duplicates = $('form [id='+fieldId+']');
if (duplicates.length > 1) {
duplicates.css("background-color","rgb(255 1 1 / 5%)")
.css("border","1px dashed rgb(255 1 1 / 20%)");
}
})
}

console.groupEnd();
}

Expand Down

0 comments on commit e9b0a55

Please sign in to comment.