ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Form requiring data in fields that aren't set as being required
Title:
B
I
{code}
?
I have a form that won't allow me to submit back to the controller if fields aren't populated with data, but in the viewmodel, these fields aren't designated as [Required]. I'd like to be able to just submit back an empty string in this case. It appears to be something in the javascript that's causing the validation to occur as the model never makes it back to the controller. What would be causing this?
Save Changes
Cancel
Sean Davidson
asked at 04 Aug 2023
besides `[Required]` there's also ValueTypes, like `int`, `DateTime`, you can make them nullable (e.g. `int?`) to allow null value.
at 04 Aug 2023
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK