1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

PrimeNG table checkbox Chrome issue: "A form field element should have an id or name attribute"

Discussão em 'Angular' iniciado por Tracy Cui, Julho 22, 2025.

  1. Tracy Cui

    Tracy Cui Guest

    So I have a column in my PrimeNG table for users to be able to select rows in the table.

    <tr class="content-thead">
    <th class="checkbox-col" scope="col">
    <p-tableHeaderCheckbox
    class="dap-recent-document-header-checkbox"
    name="document-table-checkbox"
    [inputId]="'document-table-checkbox-header'"/>
    </th>
    ....


    <tr
    role="row"
    [pSelectableRow]="document"
    [ariaLabel]="document.Name">
    <td>
    <p-tableCheckbox
    class="dap-recent-document-checkbox"
    name="document-table-checkbox"
    [inputId]="'document-table-checkbox-' + document.DocumentID"
    [value]="document"/>
    </td>
    ...


    It seems like PrimeNG's checkbox element has a child input element, which DevTools complains about not having an id or name element: Chrome Issue

    Is there a good way to resolve this error? Thanks!

    Tried adding [inputId] and name bindings to p-tableCheckbox, but that did not fix it

    Continue reading...

Compartilhe esta Página