I pass a combobox object to a function and in that function I need to get the name of the object ([B]How can I do that?[/B]) and compare it to a list of strings I already entered. Please give me an example to solve that.
var textareaSomething = document.getElementById('something');
Just give each field you want to reference a unique id value (in place of 'something' in the above example) and use document.GetElementById to reference it.
@KorJun 28.2006 — #Man, make yourself clear, otherwise I may think you try to solve a paradox. To refere an object by it's name, you must know it's name, but if you know it's name, why to search for it?
Now. Can you detail what you need? You want to refere the object with a given name or you want to find if there is an object which has the same name as a given string?
First case
var myObj = document.forms['formname'].elements['elementname']
Second case
var myString='foo';
var allElements=document.forms['formname'].elements
for(var i=0;i<allElements.length;i++){
if(allElements[i].name==myString){
... do something with the element allElements[i]....