Home > Archive > PERL CGI Beginners > December 2005 > Adding "infinite" form inputs (text boxes) using perl/javascript
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Adding "infinite" form inputs (text boxes) using perl/javascript
|
|
| Neelay 2005-12-13, 6:56 pm |
| Hi,
is there a way to add "n" number of text inputs on a CGI form, where
"n" is determined by the form user on client? For example, initially
there's a text box called "ip1" and a button besides it called "Add
IP". When the user clicks on the Add IP button, another text box called
"ip2" is printed below first one; when Add IP is clicked again, text
box ip3 is printed below ip2 and so on.
One possible solution and the one I'm not looking for is to have ip2,
ip3... within <div> with visibility set to hidden, and when Add IP is
clicked, the corresponding <div> section's visibility is set to visible
using Javascript.
It's alright to do it at server/client side; the only constraint is
that the html should get generated dynamically as the Add IP button is
clicked.
Any help will be highly appreciated!
Thanks.
-Neelay.
| |
| usenet@DavidFilmer.com 2005-12-16, 9:55 pm |
| Neelay wrote:
> is there a way to add "n" number of text inputs on a CGI form, where
> "n" is determined by the form user on client? For example, initially
> there's a text box called "ip1" and a button besides it called "Add
> IP". When the user clicks on the Add IP button, another text box called
> "ip2" is printed below first one; when Add IP is clicked again, text
> box ip3 is printed below ip2 and so on.
FWIW, the book "DHTML Utopia: Modern Web Design Using JavaScript & DOM"
by Stuart Langridge (SitePoint.com) has an example of this exact sort
of thing. You might find the code also on the SitePoint.com website
(which is a great resource).
|
|
|
|
|