douqixia7942 2016-02-03 08:40
浏览 1089
已采纳

datetime-local输入没有显示值?

I am trying to create a simple HTML form and the one element must capture the date and time, I am currently using:

 <input type="datetime-local" id="early" name="early" value="02/15/15T03:35">

However the issue is that it does not seem to populate the value of the element and just shows the normal blank values?

My format that datetime-local seems to show on Chrome is dd/mm/Y, --:-- (presumably hours:minutes)

Any help is appreciated as to the correct format?

Thanks!

  • 写回答

2条回答 默认 最新

  • douzhuang1900 2016-02-03 08:49
    关注

    The correct format shoud be something like this YYYY-MM-DDTHH:MM or YYYY-MM-DDTHH:MM:SS where T is a string literal T Example

    2016-02-01T03:35 or 2016-02-01T03:35:57

    <input type="datetime-local" id="early" name="early" value="2016-02-01T03:35">
    

    You can read and check the format here

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作