Function arguments madness.

wxdqz

New Member
I want to create a javascript function that takes names of fields (in this case three, but any number should be possible), and disables those fields inside the interface form.
This function doesn't work, because Javascript probably starts looking for the arguments array property of interface, instead of using the arguments array used by disable_field().

function disable_field(field, field2, field3)
{
if(document.all)
{
for(var i=0; i<arguments.length; i++)
{
/* Creates error because js looks for interface.arguments[] */
document.interface.arguments.disabled = true;
}
}
}

Can what I'm asking be done? Inserting a variable inside a DOM pointer? And if so, how?
 
Back
Top