| Author |
Adding more controls at runtime
|
Vivian Josh
Ranch Hand
Joined: Oct 31, 2006
Posts: 112
|
|
Hi Ranchers, I want to add more textboxes depending on need of the user. Can we do it in HTML? Eg: I want to create something similar to what we have in gmail contacts. If user wants to add more that one phone number he can click on "add" link and new textbox appears on the screen. He if wants to remove that then he can click on "remove" link. How can we create that in html/javascript? Can someone share that script or let me know where can I find it? Any help is appreciated. - Vivian
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56157
|
|
Originally posted by Vivian Josh: I want to add more textboxes depending on need of the user. Can we do it in HTML?
No. You''ll also need to employ JavaScript.
How can we create that in html/javascript?
You can explore the innerHTML property of DOM elements, or learn the DOM manipulation API. If you are going to dive into modifying the DOM dynamically, I definitely recommend adopting either of the jQuery or Prototype libraries which will make such things easier and help shield you from the browser differences. [ February 27, 2008: Message edited by: Bear Bibeault ]
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: Adding more controls at runtime
|
|
|