Skip to content

Same input id if multiple partial view are on same view #72

@AndreaLovoXTR

Description

@AndreaLovoXTR

I have a problem with input id duplicates.

In my case, I need two partial views containing a form each. These partials are then inserted inside another view.

<div class="col-lg-9 pt-4 pb-2 pb-sm-4">
    <h1 class="h2 mb-4">@HtmlLocalizer["Settings"]</h1>

    <partial name="_ProfileForm" model="@Model.Profile" />

    <partial name="../Password/_UpdatePasswordForm" model="@Model.UpdatePassword" />

</div>

I use the ReCaptcha tag helper in both forms.

However, if I go to inspect the source code from the browser, two hidden inputs are generated with the same id (g-recaptcha-response-1)

Image

Of these two, only the first field is assigned the token.

Is it possible to fix this issue? Or maybe is it possible to pass a custom id to recaptcha tag?

I'm using AspNetCore.ReCaptcha V1.8.2 with .net 8

Thanks a lot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions