本文介绍了将 html 日期选择器设置为 null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 php 页面上有一个表单,用于提交有关事件的信息.提交的信息存储在 MySQL 数据库中.
如果用户未从日期选择器中选择日期,则会将 0000-00-00 插入到数据库中.该列设置为默认为空,让我认为这种行为是由日期选择器引起的.
谁能建议一种允许插入空值的方法?
注意 - 我使用的是默认的 html 日期选择器,而不是 jqueryUI 版本.
编辑 - 仔细检查是因为数据库中的数据类型是日期,与日期选择器无关.
表格
更多推荐
将 html 日期选择器设置为 null
发布评论