Forum Moderators: open
What I want is to get to each of them. i know how many there are and therefore I thought that this'll do:
frm = document.getElementsByTagName("form");
sel = document.getElementsByTagName("select");function my {
variable = frm[0].sel[0].value;
//some operation ion variable
frm[0].sel[0].value = variable;//and similar stuff for other selects
}
However Mozilla gives me an error: frm[0].sel has no properties.
Where did I make a mistake?
Best regards
Michal Cibor
Also I'd prefer to use something like this to loop through the forms:
var frms = document.getElementsByTagname("form");
function myfunction() {
var sels;
for (var i=0; i< frms.length; i++) {
sels = frms[i].getElementsByTagName("select");
// loop through the selects in a similar manner
}
}
var frm = document.getElementsByTagName("form");
var sel = frm[0].getElementsByTagName("select");function js_saveTxt()
{
var f = sel[0].value + "%2" +
sel[1].value + "%2";
}
And the error is:
Error: frm[0] has no properties
In line 2
What to do? I'm no expert in javascript. I just want to go through all selects on one form.
Hope to hear from you
Michal Cibor