Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > add controls dynamically in html page

Reply
Thread Tools

add controls dynamically in html page

 
 
ojvm
Guest
Posts: n/a
 
      06-17-2005
thanks in advance for reading this.

i am a really ignorant about js, so i need a guru to help me.

i need to add n number of text box in a html page, the main idea is
when the user press a button apear 2 text box and if he do it again
apear 2 text box more and so on, also need that all the text boxes has
a unique id, in order to make some thing whit the values. but i dont
know how to do it. please hel me i'm trapped in this.

 
Reply With Quote
 
 
 
 
Jc
Guest
Posts: n/a
 
      06-17-2005
ojvm wrote:
> thanks in advance for reading this.
>
> i am a really ignorant about js, so i need a guru to help me.
>
> i need to add n number of text box in a html page, the main idea is
> when the user press a button apear 2 text box and if he do it again
> apear 2 text box more and so on, also need that all the text boxes has
> a unique id, in order to make some thing whit the values. but i dont
> know how to do it. please hel me i'm trapped in this.


You will need to learn how to manipulate the browser DOM through
javascript in order to do this. This is referred to as DHTML,
http://www.w3schools.com/ is listed as a reference for DHTML on this
groups FAQ, which is located at http://www.jibbering.com/faq/.

You will likely choose to use one of two techniques:

1. The document.createElement() method combined with
appendChild()/insertBefore().

2. The innerHTML property.

References on these methods/properties can be found here:
http://msdn.microsoft.com/library/de...ence_entry.asp

You will also need to use javascript control statements such as a loop
in order to easily add multiple textboxes:
http://msdn.microsoft.com/library/de...eReference.asp

 
Reply With Quote
 
 
 
 
ojvm
Guest
Posts: n/a
 
      06-20-2005
thank for help, but i really don't know who to start.

 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      07-03-2005
ojvm wrote:

> thank for help, but i really don't know who to start.


Try yourself.


SCNR

PointedEars
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
this.Controls.Add(Control) Does Not Add Control to child collection (this.Controls.Count == 0) Chad Scharf ASP .Net 3 10-18-2007 03:53 PM
add controls dynamically in html ojvm Javascript 1 06-24-2005 01:56 PM
add controls dynamically in html page ojvm Javascript 0 06-20-2005 08:39 PM
add controls dynamically in html page ojvm Javascript 0 06-20-2005 01:59 PM
Dynamically add controls to a page Jeremy S ASP .Net 1 03-04-2004 08:37 AM



Advertisments