Re: unknown number of inputs
| From: | Shawn McKenzie | Date: | Thu, 09 Apr 2009 22:58:43 +0000 |
| Subject: | Re: unknown number of inputs | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-291316@lists.php.net to get a copy of this message | ||
PJ wrote:
> I have a script with $_POST and <form> to load data with text input.
> Situation: enter name of author(s) for book. I have the script set up to
> enter first_name, last_name for Author1 and the same for Author 2.
> Check if entry 1 exists then proceed accordingly
> Check if entry 2 exists then proceed accordingly.
> Now, If I have three or more authors to enter, is there a way to add a
> radio button to add more rows for input or to skip further inputs, if I
> have to enter the inputs for each additional author?
> I'm looking for a simple way to do this. Could or should Ajax be
> involved in this somehow?
>
Ajax would be a good way to go if it could be an undetermined number of
authors. But if you have a limit (like 3 or 4 or 5) then just include
the text fields for that number.
For Ajax you might have a button or link that says "add more authors"
and when clicked the javascript adds an additional input to the form.
--
Thanks!
-Shawn
http://www.spidean.com