473,503 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

looping through an HTML

29 New Member
Hi. Everyone
I’m trying to loop through an html document to perform some tasks. The html document contains a couple of input boxes which gather the data from the user. However, to complete my task I need to get the name of each input box and the value of entered data. The former is archived by these statements:
var myelements=document.getElementsByTagName("input");
for (var i=0;i< myelements.length;i++){
var boxname=myelements[i].name
var boxvalue=
Unfortunately, I stuck with how to get the input box’s value.

Any help is much appreciated

Cheers
Apr 20 '07 #1
3 1071
korinth
5 New Member
have you tried using .value?

it seems like if you're trying to get whatever is in the input field, myelement[i].value should work. at least if it's a text field.

if it is another form of input, like a radio button or a checkbox, you have to specify the value in the tag.
Apr 20 '07 #2
elsheh
29 New Member
Thanks Korinth
Actually it’s a text field. But, unfortunately element[i].value doesn’t work. any clue?
Cheers

have you tried using .value?

it seems like if you're trying to get whatever is in the input field, myelement[i].value should work. at least if it's a text field.

if it is another form of input, like a radio button or a checkbox, you have to specify the value in the tag.
Apr 23 '07 #3
elsheh
29 New Member
thanks alot Korinth
got it.
cheers
Thanks Korinth
Actually it’s a text field. But, unfortunately element[i].value doesn’t work. any clue?
Cheers
Apr 23 '07 #4

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

Similar topics

2
3977
by: ensnare | last post by:
Hi all, I'm using a database session handler and am looking to loop through data residing in the sessions table to make a 'Users online' array. I've found that using urldecode on the data...
2
2156
by: jason | last post by:
What is the best way to build a dynamic html body message if one is looping through a customer table (=/=500 customers) and corresponding inventory table: 1. FSO html template with paramters 2....
3
1416
by: HenryW | last post by:
I have a section of ASP code that dynamically builds a table. And per usual it writes out to the table like so: Response.Write("<td><font face=""Verdana"" size=""2""><b> Status...
5
2993
by: Jonboy | last post by:
Hi all, I have a .swf file...and thats all i have. A relic. I am wondering how I can make use of it in a webpage? I don't have the associated html to go with it. Also in thehtml is it...
1
6411
by: Jozef | last post by:
Hello, I'm trying to loop through forms by doing a "For Each" in the Currentdb. I'm doing this like the following; Dim db as dao.database Dim docLoop as document Dim ctrl as control Set db...
6
1798
by: Luke - eat.lemons | last post by:
Hi, Im pretty new to asp so all light on this question would be great. Basically i need to test to see what value is set (where to retrieve the data from) so ive done it like this: If...
3
1278
by: Luke - eat.lemons | last post by:
Sorry for the post in this NG but im short on time to get this working and i haven't seem to of got a response anywhere else. Im pretty new to asp so all light on this question would be great. ...
5
1916
by: talktozee | last post by:
Hello, everyone! Here's are the basics: 1. The query looks at all positions that are active and haven't been filled. 2. It then has to look at every single position and determine three...
1
1836
by: assgar | last post by:
Hello I have changed the process code abit so it receives the data from the form and ensures the data in array format. This has eliminated my previous error. The problem I am experiencing...
3
1938
by: chiku1523 | last post by:
Hi, Please find the following code. In function setAnswers, I am looping with each question. I have inner loop, which is looping for each answers of the questions. If any of the answer for question...
0
7204
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7091
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...
1
6998
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
4680
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1516
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
391
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.