hi..
im dynamicelly creating text box in a html file using javascript..
<script>
function create_input_boxes()
{
if(document.getElementById("name0"))
{
return true;
}
var boxes="";
var num_boxes=document.getElementById("num_boxes").value;
if(num_boxes)
{
for(var i=0;i<num_boxes;i++)
{
boxes+="<input id='name"+i+"' name='name"+i+"' value=''><br />";
}
document.getElementById("textbox_container").innerHTML=boxes;
}
return false;
}
</script>
</head>
<body>
<form id="theForm" action="dynamic.php" method="post" onsubmit="return create_input_boxes();">
<div id="textbox_container"></div>
Enter number input boxes: <input name="num_boxes"><br />
<div id="submit_button"><input type="submit" name="submit" value="Submit"></div>
</form>
</body>
while im trying to retrieve the values in php..
i get parse error in line 17. in my php file..
<html>
<head>
</head>
<body>
<?php
if(isset($_POST["submit"]))
{
for($i=0;$i<count($_POST);$i++)
{
$name[]=!empty($_POST["name".$i])?$_POST["name".$i]:"";
// All dynamically created inputs are being stored again in $name array
}
for($i=0;$i<count($name);$i++)
(
echo $name[$i];
}
}
?>
</body>
</html>
plz help me in correcting the code.. Thank u