Hi
I do have a problem changing the name of fields using js....
I'm sure there's an easy solution but i can't figure it out ^^
I just want to change the names of formfields (inputs or textareas)
this expression should set the name of the first Element named myName to test.
i wanted to include this feature into this function
I do have a problem changing the name of fields using js....
I'm sure there's an easy solution but i can't figure it out ^^
I just want to change the names of formfields (inputs or textareas)
Code:
document.getElementsByName('myName')[0].name = 'test';
this expression should set the name of the first Element named myName to test.
i wanted to include this feature into this function
Code:
function setName(name)
{
var Elemente = new Array();
for(i=0; ;i++)
{
node = document.getElementsByName(name + i);
if(node[0] == null && document.getElementsByName(name + (i+1))[0] == null)
break;
for(j=0; j<node.length; j++)
Elemente.push(node[j]);
}
for(i=0; i<Elemente.length; i++)
Elemente[i].name = name + i;
}