I have more than one File field forms named filename0, filename1,
filename2, and so on.....
And then I use javascript to read the value:
document.formupload.filename0.value
document.formupload.filename1.value
But I want to iterate it in a FOR loop, to save long codes.
for (i = 0; i < 9; i++) {
document.formupload.filename(???).value
}
How do I use JS to solve the above problem, to replace the (???), to
read the values of all the forms.
This surely have been answered before, but I don't know what keywords
to google for.
So anyone can help will be appreciated. TIA
roger 4 1429
essayez :
for (i=....) {
var xx=document.formupload.filename + i;
alert (xx.value);
}
HelLind a écrit: I have more than one File field forms named filename0, filename1, filename2, and so on.....
And then I use javascript to read the value:
document.formupload.filename0.value document.formupload.filename1.value
But I want to iterate it in a FOR loop, to save long codes.
for (i = 0; i < 9; i++) { document.formupload.filename(???).value }
How do I use JS to solve the above problem, to replace the (???), to read the values of all the forms.
This surely have been answered before, but I don't know what keywords to google for.
So anyone can help will be appreciated. TIA
roger
G Roydor <gu********@NOlaposteSPAM.net> wrote: HelLind a écrit: I have more than one File field forms named filename0, filename1, filename2, and so on.....
And then I use javascript to read the value:
document.formupload.filename0.value document.formupload.filename1.value
But I want to iterate it in a FOR loop, to save long codes.
for (i = 0; i < 9; i++) { document.formupload.filename(???).value }
How do I use JS to solve the above problem, to replace the (???), to read the values of all the forms.
This surely have been answered before, but I don't know what keywords to google for.
essayez :
for (i=....) { var xx=document.formupload.filename + i;
alert (xx.value); }
a.b is equivalent to a["b"]
document.formupload["filename" + i]
Regards,
Steve
HelLind wrote: I have more than one File field forms named filename0, filename1, filename2, and so on.....
And then I use javascript to read the value:
document.formupload.filename0.value document.formupload.filename1.value
But I want to iterate it in a FOR loop, to save long codes.
for (i = 0; i < 9; i++) { document.formupload.filename(???).value }
var f=9
while(f--){document.formupload["filename+i].value}
Mick
How do I use JS to solve the above problem, to replace the (???), to read the values of all the forms.
This surely have been answered before, but I don't know what keywords to google for.
So anyone can help will be appreciated. TIA
roger This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: deko |
last post by:
I have a file that contains the output of time(). A different time is on
each line of the file, and each line represents a visit to the website. I
want to calculate the total visits per day,...
|
by: nc |
last post by:
My iterator can find my collection when my Action class calls my jsp
directly, however when my Action class calls an html file that is set
up with IFrames (one of which is loading that same jsp), I...
|
by: googler |
last post by:
I'm trying to read from an input text file and print it out. I can do
this by reading each character, but I want to implement it in a more
efficient way. So I thought my program should read one...
|
by: rajarshi.guha |
last post by:
Hi, I have an XML file which contains entries of the form:
<idlist>
<myID>1</myID>
<myID>2</myID>
.....
<myID>10000</myID>
</idlist>
Currently, I have written a SAX based handler that will...
|
by: ahammad |
last post by:
Well, the title pretty much describes what I want to do. I want to be able to read the contents of a Word document (*.doc). I also want to be able to read it to a CString object, and then search that...
|
by: Steve |
last post by:
Hello-
I have numerous variables called varNameX (where X is equal to a
number from 0 to a known number "n").
Using VB.NET, I would like to iterate through all of these variables
to run...
|
by: Steve |
last post by:
Hello-
I have numerous variables called varNameX (where X is equal to a
number from 0 to a known number "n").
Using VB.NET, I would like to iterate through all of these variables
to run...
|
by: stef mientki |
last post by:
hello,
I generate dynamically a sequence of values,
but this "sequence" could also have length 1 or even length 0.
So I get some line in the form of:
line = '(2,3,4)'
line = ''
line = '(2)'...
|
by: tushar.saxena |
last post by:
Hi,
I'm trying to read a file using the istearm class (I cant use ifstream
since the input might be a file or it might be stdin).
istream *input;
// Add checks for file name here, else use...
|
by: Bill Cunningham |
last post by:
I am interested in writing a numeric text reader. This only reads
numbers of securities and stores them. Nice practice. I have determined that
these functions are needed.
isalpha, isdigit,...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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,...
|
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...
| |