Code: Select all
<script language="JavaScript">
var iteration = 0;
function AddToIngList (form, iteration)
{
var it = iteration;
var Ingredient = form.ingredienttoadd.value;
form.ingredients_added.value += Ingredient + "\n";
var objHTML, objText, objinput;
objHTML = document.createElement('P');
objHTML.setAttribute('NAME', 'txtTest');
objHTML.setAttribute('ID', 'txtTest');
var strTest = form.ingredienttoadd.value;
objText = document.createTextNode(strTest);
objinput = document.createElement
('INPUT');
objinput.name = "input"+it;
objinput.value = "";
document.body.appendChild(objHTML);
objHTML.appendChild(objText);
objHTML.appendChild(objinput);
alert(objinput.name);
}
</script>Code: Select all
onClick=\"iteration ++; AddToIngList(this.form, iteration);\">";the problem is this. It seems that the value from the input boxes are not goin into the $_POST array.
Code: Select all
$test = $_POST['input1'];
echo"<p><b>$test</b></p>";can anyone help me???