Input uses required and readonly to verify conflicts with each other

when using time or tree components in input (* required fields), some components will be available for input. If you use readonly, and add required, you will have the problem of verifying required fields and not filling them without prompts.

< hr >

< label class= "col-sm-2 control-label" > finish date: < / label >

< div class= "col-sm-4" >
< input type= "text" id= "date_end" class= "form-control" required= "required" readonly >
< / div >

Jun.02,2021

layui is not operated on the original dom, but the virtual dom, time controls generated by ourselves are no longer input boxes, just trigger points. So you can't use


as a normal input box.

find a better solution and directly onfocus= "this.blur ()"

< label class= "col-sm-2 control-label" > finish date: < / label >

< div class= "col-sm-4" >
< input type= "text" id= "date_end" class= "form-control" required= "required" onfocus= "this.blur ()" >
< / div >

Menu