Skip to content

Commit

Permalink
Update validation.md (dotnet#15998)
Browse files Browse the repository at this point in the history
* Update validation.md

* Update validation.md
  • Loading branch information
Rick-Anderson authored Dec 5, 2019
1 parent faf0363 commit 851d08a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aspnetcore/mvc/models/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ Notice that the `data-` attributes in the HTML output correspond to the validati

Data type validation is based on the .NET type of a property, unless that is overridden by a `[DataType]` attribute. Browsers have their own default error messages, but the jQuery Validation Unobtrusive Validation package can override those messages. `[DataType]` attributes and subclasses such as `[EmailAddress]` let you specify the error message.

## Unobtrusive validation

For information on unobtrusive validation, see [this GitHub issue](https://github.com/aspnet/AspNetCore.Docs/issues/1111).

### Add Validation to Dynamic Forms

jQuery Unobtrusive Validation passes validation logic and parameters to jQuery Validate when the page first loads. Therefore, validation doesn't work automatically on dynamically generated forms. To enable validation, tell jQuery Unobtrusive Validation to parse the dynamic form immediately after you create it. For example, the following code sets up client-side validation on a form added via AJAX.
Expand Down

0 comments on commit 851d08a

Please sign in to comment.