我从这样的javascript创建了一个输入:
<form action='' method='post' name='create'>
<span id="duration"></span>
</form>
function duration(){
document.getElementById('duration').innerHTML += "<label>Deadline :</label><input type='date' name='deadline' id='deadline' onchange='pengumuman(this.value)' class='form-control' min=" + date('now', 0, 'ymd') + " max=" + date('now', 7, 'ymd') + ">";
}
我在表单中创建了一个span,但每当我尝试提交此表单并打印时,我都没有从此输入中获得值(string(0) = "") or $_GET['deadline']; (and i just tried $_POST['deadline'] also but still the same. not found Undefined index: deadline
。如何解决这个问题?从javascript创建的输入是否无法以表格形式输入?