M
Michael Hill
This a valid call:
document.myform.elements['myelement']
so is this:
document.forms[0].elements[1]
but not this:
document.forms[0].elements['myelement']
So, I have to iterate through the elements to find my field and make a
change to the element properties
myfield = "myelement";
for ( i=0; i<document.forms[1].elements.length; i++ )
{
if ( document.forms[1].elements.name == myfield )
{
document.forms[1].elements.class = "newstylesheetformat";
}
}
}
Why is the document.forms[1].elements.class property not accessible
using this method even though I specified it in the form?
If I wanted to iterate through the properties of the elements how would
I do this, like this?
for ( i=0; i<document.forms[1].elements.length; i++ )
{
for ( j=0; j<document.forms[1].elements.properties.length; i++ )
{
alert(document.forms[1].elements.properties.name);
}
}
}
document.myform.elements['myelement']
so is this:
document.forms[0].elements[1]
but not this:
document.forms[0].elements['myelement']
So, I have to iterate through the elements to find my field and make a
change to the element properties
myfield = "myelement";
for ( i=0; i<document.forms[1].elements.length; i++ )
{
if ( document.forms[1].elements.name == myfield )
{
document.forms[1].elements.class = "newstylesheetformat";
}
}
}
Why is the document.forms[1].elements.class property not accessible
using this method even though I specified it in the form?
If I wanted to iterate through the properties of the elements how would
I do this, like this?
for ( i=0; i<document.forms[1].elements.length; i++ )
{
for ( j=0; j<document.forms[1].elements.properties.length; i++ )
{
alert(document.forms[1].elements.properties.name);
}
}
}