Skip to content

Manually validating a dynamically added form #55

Closed
@max-maurice

Description

@max-maurice

After adding a form to the DOM (with watch enabled), a call to isValid() fails, when submitting the form:

window.validationService.isValid(form, false);

The error TypeError: formInputUIDs is undefined occurs at

let invalidFormInputUIDs = formInputUIDs.filter(uid => this.summary[uid]);

Variables:
grafik

Simplified form markup:

<form method="post" action="https://localhost:7222/item/disableitem/20/">
	<div class="validation-summary-valid" data-valmsg-summary="true"><ul><li style="display:none"></li></ul></div>
	<button type="submit">Yes</button>
	<input name="__RequestVerificationToken" type="hidden" value="xxx">
	<button type="button">No</button>
</form>

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