I'm trying to make a form that the allows the user to add or remove inputs (text box) to a form if they click a "+" or "-" button.
Right now it will only let me add one box (and also remove it), but I can't add any more than that.
EDIT - I got it to work using GET. Here's what I did if you're interested.
<?
$j=1; //sets the value initially when the page is first loaded
if($_GET['num'] >= 1 ){
$j = mysql_real_escape_string($_GET['num'])+1;
}
//displays the text boxes
echo '<table>';
for($i = 0; $i<$j; $i++){
echo '<tr><td><input type="textbox" name="input[]"></td></tr>';
}
//displays the + and - buttons to add or remove text boxes
$a = $j-2;
echo '</table>';
echo '<a href="helplist.php?num='.$j++.' "> + </a>';
echo '<a href="helplist.php?num=' .$a. '"> - </a>';
?>