php - 来自 onclick 输入的 PHP 值
问题描述
日历中有两个字段,输入的初始日期和当前日期,其中选择了日期。我只是不知道如何在使用 onclick 选择后提取值我通过 POST 通过 id 或 name 尝试但它仍然不适用于通常的输入,使用 POST 方法一切都很好
<form method="post">
<h3>Click on the date entry field to call the calendar.:</h3>
<p>
from the <input name="d1" type="text"
value="day month Year"
onfocus="this.select();_Calendar.lcs(this)"
onclick="event.cancelBubble=true;this.select();_Calendar.lcs(this)"
data-yearfrom="-80"
data-yearto="5">yearto="5" />
to the <input name="d2" type="text"
value="day month Year"
onfocus="this.select();_Calendar.lcs(this)"
onclick="event.cancelBubble=true;this.select();_Calendar.lcs(this)"
data-yearto="5">yearto="5" />
<input type="submit" name="select1" form="myform" value="data from bd" />
</p>
</form>
解决方案
修复了所有语法错误:
<form method="post" id="myform">
<h3>Click on the date entry field to call the calendar.:</h3>
<p>
from the <input name="d1" id="d1" type="text"
value="day month Year"
onfocus="this.select();_Calendar.lcs(this)"
onclick="event.cancelBubble=true;this.select();_Calendar.lcs(this)"
data-yearfrom="-80"
data-yearto="5"/>
to the <input name="d2" id="d2" type="text"
value="day month Year"
onfocus="this.select();_Calendar.lcs(this)"
onclick="event.cancelBubble=true;this.select();_Calendar.lcs(this)"
data-yearto="5"/>
<input type="submit" name="select1" form="myform" value="data from bd"/>
</p>
</form>
推荐阅读
- c++ - 如何在 vs code c++ 中添加静态库?
- matlab - 导入某些值的数据时,Matlab“失去”“幂”值
- javascript - 让机器人对其上方的消息做出反应
- angular - 如何处理 tiff 图像,以便可以在 chrome 中显示角度?
- ios - 为未知枚举返回相同的原始值
- python - 混合日期时间格式需要是一种格式
- c# - SignInManager.IsSignedIn(User) 方法总是返回 false
- javascript - 无法读取从documents.getElementsByName获取的NodeList的字段
- python - 你知道为什么 Django ls 可能不会出现在项目目录中吗?
- python - 从带有结构的 MATLAB .mat 文件到 numpy 数组的建议?