简体   繁体   中英

.NET MVC disable native validation message on time input

I have an input field of type time as following

 <input type="time" name="visible-start-time" id="visible-start-time" class="form-control half-input" value="@(Model==null?"":Model.StartTime.TimeOfDay.ToString())"/> 

在此处输入图片说明

I do not want the native html validation message to be shown.

You need to add a novalidate attribute to your <form> tag to disable the browsers native validation (For all controls).

It's explained here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM