abs wrote:
Input field of the form. How to check which number this field has ? I
mean the order number, like variable elementNumber in
document.forms[formnumber].elements[elementNumber] ? Is it possible
to check without looping and comparing some attributes in every loop ?
Best regards,
ABS
Why do you need this? Just curious. The only way afaik to do it without
run-time looping is to use a script onload that sets an index property
on each element:
window.onload = function()
{
var f, els, el, i = 0, j;
while (f = document.forms[i++])
{
els = f.elements;
j = 0;
while (el = els[j])
el.index = j++;
}
}
Then access as elementObj.inde x.