473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

To access textbox added to div tag using innerHTML

I have created a dynamic HTML page using div tag in which when a drop down is selected that number of text boxes appear.
This I did by calling a function disp() wherein a new div tag is created, and then the number of text boxes I made, I put them in innerHTML code of the newly created tag and then I appended this div tag to the main div tag of HTML page..

Now the problem is that when the user clicks on submit a validate() is called.
here I want to access those textboxes and check them.
How can this be done.??

simply stating how can i access those elements which I have attached to a div tag using innerHTML....

plz help
Jul 3 '07 #1
3 2766
acoder
16,027 Expert Mod 8TB
Give your text boxes ids and use document.getElementById to access them.

If you get stuck, post some example code.
Jul 3 '07 #2
arnabc
6
I have created a dynamic HTML page using div tag in which when a drop down is selected that number of text boxes appear.
This I did by calling a function disp() wherein a new div tag is created, and then the number of text boxes I made, I put them in innerHTML code of the newly created tag and then I appended this div tag to the main div tag of HTML page..

Now the problem is that when the user clicks on submit a validate() is called.
here I want to access those textboxes and check them.
How can this be done.??

simply stating how can i access those elements which I have attached to a div tag using innerHTML....

plz help

to validate the text boxes i assume u have one form and u r appending those text boxes inside the form so in that case u can get them by accessing formName.elements array OR by getElementById as suggested by "acoder".
Jul 3 '07 #3
gits
5,390 Expert Mod 4TB
in case you want to retrieve a list of textboxes that you have added you may use getElementsByTagName('tagname'); and loop through that collection of nodes ... its the standard-compliant-(dom)way to retrieve a list of nodes that have the same tagName ...

kind regards ...
Jul 3 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ed | last post by:
Hi, I'm stuck at the moment trying to work out how to access the value of a textfield which gets added in a DIV element. I have functions to add and remove the textfields from the elements as...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
1
by: Jan Van Steenbergen | last post by:
Hi all i'm having a little problem I have a aspx file with a iFrame defined The iframe is loaded with a html webeditor After editing data in the webeditor textbox, i want t get the data to a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.