add row on the fly
| From: | Patricia Hu | Date: | Fri, 20 Oct 2000 22:20:39 +0000 |
| Subject: | add row on the fly | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-21496@lists.php.net to get a copy of this message | ||
Hi PHPers,
I have a form with only 1 row for the moment for the user to input data, and an ADD ROW button or link to the right of the row so the user can click to get another row with same structure directly below the original one in case they just need another row(very likely), and do this again and again till the user has input all data she has. I know this can be done in JavaScript, but can I do it with pure PHP? I have tried to use a counter i so
========================================================
$i=0;
do {
$i++;
<input type=text name='var'.$i>
....
<input type=submit name='addrow'.$i value='Add Row'>
$add='addrow'.$i;
} while (($i<100) && ($$add == 'Add Row'))
========================================================
But it will only 1 extra row, other than that, it actually deletes 1 row. What is wrong with my code? Does it have sth to do with the relative position of the row?
Any input/idea would be most appreciated. Have a nice weekend.
Patricia
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at http://profiles.msn.com.