How to Validate date and time using html5 -


i use html5 feature getting date , time follw

<input type="datetime-local" name="dtl" id='dd'> 

it work fine want start current date , time,previous date , time should not allowed use.

so please suggest me how it.

you're gonna need javascript this. create date , assign datatime-local input field:

var date = new date(),     dd = document.getelementbyid('dd'); dd.value = date.toisostring(); 

fiddle

to require date in future, modify min attribute of input, that's not going work because day no major browser date supports type of input. might better off using javascript-based date picker job.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -