On Nov 15, 8:59 pm, "\"A_Michigan_User\""
<Michigan_RE_M...@ameritech.netwrote:
I call this Javascript function with "GetEleNum(this)"
passing it 1 of the elements of a text-box array.
Is there a QUICK way to get the "element #"? I'm currently using this
SLOW code.
(It works... but I need something better/faster.)
function GetEleNum(c)
{
// Given 1 element in this textBox array... what is the array element #?
var i;
for(i=0; i<form1.txtBox.length; i++)
if(form1.txtBox[i] == c) return i;
return 0; // Not found
}
Thanks
Try organizing your question into something understandable, PLEASE!
This way, I don't know what you're asking, what you're trying to
accomplish, anything.
Suggestion nr. 1: don't use 'u' instead of 'you', '1' instead of
'one', '#' instead of 'number' etc.
Suggestion nr. 2: explain what specific terms mean, e.g. what your
txtBox's -are-, what 'element #' means
(I suppose it's an ordinal number in an array, but -
what- array, or have you maybe meant
element's ID, etc.
Suggestion nr. 3: the way you're doing it right now - DOESN'T work.
What if the element is on the first place
(index 0)? You'll understand it the same like it
wasn't found, right?
Regards