It's not a secret anymore!*
The moose likes HTML, CSS and JavaScript and the fly likes How do i create dynamic input fields after click a button? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How do i create dynamic input fields after click a button?" Watch "How do i create dynamic input fields after click a button?" New topic
Author

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

Derek Bright
Greenhorn

Joined: Aug 28, 2008
Posts: 28
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

Joined: Aug 28, 2008
Posts: 28
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?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60789
    
  65

Yup.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
http://www.pascarello.com/examples/createElement.html

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do i create dynamic input fields after click a button?
 
Similar Threads
Dynamically added form fields cannot access from request access
Select tag 's selection should persist.
HTML qn=== Urgent!!!
cloning labels
dynamically adding textboxes