Skip to content

Unable to define an optional DateOnly field in blazor EditForm using InputDate component #52195

Closed
@nvmkpk

Description

@nvmkpk

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I am trying to bind a InputDate component to a nullable DateOnly property. When I click on the submit button, I see a validation message The value '' is not valid for 'Date'

Expected Behavior

Form should be submitted without any validation errors.

Steps To Reproduce

  1. Clone the project at https://github.com/nvmkpk/BlazorAppRepro1
  2. Run the project
  3. Click on Counter link on the left
  4. Click on Click me button
  5. Observe the validation error message

Exceptions (if any)

None

.NET Version

8.0.100

Anything else?

This only happens when not using any of the interactive modes. The form post sends empty string for the date field that cannot be parsed to a valid date on the server side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions