• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do i create dynamic input fields after click a button?

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, my jsp has a button that once a user clicks, a new input field, say a textbox appears. If he clicks the button again, another new input field will appear...below is an illustration:

Add text box JSP
---------------------------
<Add New TextBox Button>

After i click the button once,
The page will become:

Add text box JSP
----------------------------
Name: ___________
<Add New TextBox Button>

After i click the button again,
The page will become:

Add text box JSP
----------------------------
Name: ___________

Name: ___________
<Add New TextBox Button>

How can this be done? And how can i retrieve such values? Thanks!
 
Derek Bright
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just come across javascript to help me solve the above problem, is this the probable way or another way to ask will be is this the best way to solve the above issue?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.pascarello.com/examples/createElement.html

Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic