ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Comparing date Fields Inputs inside popup
Title:
B
I
{code}
?
Is there a way to compare date input fields client-side against each other? I have an edit pop-up that has beginning and ending date fields and I want to verify that the entry in the beginning field is less than or equal to the ending field.
Save Changes
Cancel
Sean Davidson
asked at 06 Dec 2019
Answers
B
I
{code}
?
if you're using the `PopupForm` you could actually do it in the controller, the validation will be "ajax-based" this way, you return `PartialView` when ModelState is invalid and the content of the popup will be replaced and it will contain the validation message, or you could write custom js (perhaps using jquery.validate) to compare the date values, have a look here: https://demo.aspnetawesome.com/DatePickerDemo#Datepicker-Api you can see here how to get the datepicker value as a Date type
Save Changes
Cancel
Omu
answered at 06 Dec 2019
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