D
dodgeyb
Hi there, javascript newbie here, having to convert my asp.net (vb)
code to client side javascript.
I have several textareas (number varies) and I need to a function to
loop through them & disable them all EXCEPT one textarea which is the
parameter passed. So the parameter passed to the function is the name
of the textarea required to stay enabled.
I have so far :
function btnSet_Click(id){
var ele = document.getElementsByTagName('textarea');
if(ele != null)
for(i=0;i<ele.length;i++)
{
if(ele(i).name==id){
ele(i).disabled=false;
}
else
ele(i).disabled=true;
}
}
The loop is working, but I'm wide of the mark on the comparison line I
think.
All help much appr'd !
Chris
code to client side javascript.
I have several textareas (number varies) and I need to a function to
loop through them & disable them all EXCEPT one textarea which is the
parameter passed. So the parameter passed to the function is the name
of the textarea required to stay enabled.
I have so far :
function btnSet_Click(id){
var ele = document.getElementsByTagName('textarea');
if(ele != null)
for(i=0;i<ele.length;i++)
{
if(ele(i).name==id){
ele(i).disabled=false;
}
else
ele(i).disabled=true;
}
}
The loop is working, but I'm wide of the mark on the comparison line I
think.
All help much appr'd !
Chris