datetime-local值未出现在输入标签上 [英] datetime-local value doesn't appear on input tag

查看:263
本文介绍了datetime-local值未出现在输入标签上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个php页面,可以在其中编辑给定的截止日期&时间。
单击编辑按钮后,datetime-local的先前值不会出现在datetime框中。

I was making a php page where I can edit a given closing date & time. After clicking the edit button, the previous value of datetime-local doesn't appear on the datetime box.

先前值为 2016-06-17 19:07:00

它看起来像这样 mm / dd / yyyy- :-:-

此值不显示前一个值:

<input type="datetime-local" name="c_datetime" value=<?php echo $row[5] ?> />

但是当我这样做时,它会正确显示日期和时间。

But when I do it like this it properly display the date and time.

<?php echo $row[5] ?>

如何显示上一个值?

预先感谢!

推荐答案

似乎您可能在php代码中缺少一些引号:

It looks like you may be missing some quotation marks around the php code:

<input type="datetime-local" name="c_datetime" value="<?= str_replace(" ", "T", $row[5]) ?>" />

这篇关于datetime-local值未出现在输入标签上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆