javascript - post does not give me a value when i filling dropdown from array
Get the solution ↓↓↓"answer" works correctly but "number" has problem
function add() {
<? addToDakavebebi($_POST['answer'], $_POST['number']);?>
}
<form method="post">
<tr>
<select id='number'>
<option value="">select</option>
</select>
<select name="answer">
<option value="">select</option>
<option value="1">YES</option>
<option value="2">NO</option>
</select>
<input type="submit" value="SAVE" onclick="add()">
</tr>
</form>
it fills box correctly on page
<script>
var ddlItems = document.getElementById("number"),
itemArray = ["a", "b", "c"];
for (var i = 0; i < itemArray.length; i++) {
var opt = itemArray[i];
var el = document.createElement("option");
el.textContent = opt;
el.value = opt;
ddlItems.appendChild(el);
}
</script>
.........................................................................................................
Answer
Solution:
Add name number to the field. At the moment your server cannot grab that data
<select id='number' name='number'>
<option value="">select</option>
</select>
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: port 80 in use by "unable to open process" with pid 4!
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.