Help - Search - Member List - Calendar
Full Version: dynamically creating a input box, can this be done?
WorkTheWeb Forums > Webmaster Resources > PHP Help
Support our Sponsors!
jj
hello everyone,

Im going to try to simplify my problem as much as i can:

Lets say I have a single form element (an input box).
and a button next to it. I would like this button when pressed to create a
second input box and second button right below that one (exactly the same
button and input box). Then if i were to press that second button, a third
row of input box and button would be created below, and so on and so on.

Can any one shed some light for me how i would go about doing this?

Thanks.

countach
En las nuevas, el jj escribi:
QUOTE
hello everyone,

Im going to try to simplify my problem as much as i can:

Lets say I have a single form element (an input box).
and a button next to it.  I would like this button when pressed to
create a second input box and second button right below that one
(exactly the same button and input box).  Then if i were to press
that second button, a third row of input box and button would be
created below, and so on and so on.

Can any one shed some light for me how i would go about doing this?

This is Javascript, not PHP.

Please check out Javascript-related sites and focus on DOM (Document Object
Model) functions. Yes. It can be done.

This is a good place to start:
http://www.w3schools.com/js/js_obj_htmldom.asp

Geoff Berrow
I noticed that Message-ID: <[Email Removed]> from countach
contained the following:

QUOTE
Im going to try to simplify my problem as much as i can:

Lets say I have a single form element (an input box).
and a button next to it.  I would like this button when pressed to
create a second input box and second button right below that one
(exactly the same button and input box).  Then if i were to press
that second button, a third row of input box and button would be
created below, and so on and so on.

Can any one shed some light for me how i would go about doing this?

This is Javascript, not PHP.
Well you could do it with PHP, but I'd like to know more details of the

problem.

--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011

Tony
Geoff Berrow wrote:
QUOTE
I noticed that Message-ID: <[Email Removed]> from
countach contained the following:

Im going to try to simplify my problem as much as i can:

Lets say I have a single form element (an input box).
and a button next to it.  I would like this button when pressed to
create a second input box and second button right below that one
(exactly the same button and input box).  Then if i were to press
that second button, a third row of input box and button would be
created below, and so on and so on.

Can any one shed some light for me how i would go about doing this?

This is Javascript, not PHP.
Well you could do it with PHP, but I'd like to know more details of
the problem.

To do it by posting back with each item entered, you could use PHP. To do it
without posting to the server would require Javascript.

Of course, it wouldn't work for those with Javascript turned off.

Another resource to try is comp.lang.javascript

--
Tony Garcia
Web Right! Development
Riverside, CA
www.WebRightDevelopment.com

Hello
Sure you can. First button posts with a hidden value "1" then it reads off
and adds to the value and outputs as many boxes as the amount of value
dictates. So, there will be next page generated with 2 boxes and hidden
value of 2 (or you can do session, whatever).

"jj" <[Email Removed]> wrote in message
news:vktBe.5779$[Email Removed]...
QUOTE
hello everyone,

Im going to try to simplify my problem as much as i can:

Lets say I have a single form element (an input box).
and a button next to it.  I would like this button when pressed to create
a
second input box and second button right below that one (exactly the same
button and input box).  Then if i were to press that second button, a
third
row of input box and button would be created below, and so on and so on.

Can any one shed some light for me how i would go about doing this?

Thanks.




PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.