i created an input from javascript like this:
<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') + ">";
}
And i created a span inside a form, but whenever I tried to submit this form and print I got no value (string(0) = "") or $_GET['deadline']; (and i just tried $_POST['deadline'] also but still the same. not found Undefined index: deadline from this input. How to fix this? Do created input from javascript can't be inputted in form?
$_POST['deadline'];