Re: getElementByName within containing DIV
- From: DanWeaver <danofweaver@xxxxxxxxxxxxxx>
- Date: Sun, 30 Mar 2008 16:10:41 -0700 (PDT)
Thanks Joost and George-
Joost- yes youre right about my error in placing the code here- I
meant:
Id like to do the following (input-->inputbox):
function HmmFunc(ref)
{
var moo = ref.parentNode.id;
var x=document.getElementById(moo).getElementByName('inputbox');
x.value = "newvalue"
}
But the reason my solution isnt great is that I already know the input
control I want as long as I know the div that it is within (which I
do)- it seems crazy to have to create an array of all tagnames ie all
<input> elements and then extract the one I want. In the scenario
there may be 10 inputs and 10 similar (though uniquely id'd) divs: I
want a handle on an input where name="inputname" so I can populate it-
I am not interested in the other input boxes within the div. The
input of course has a unique id but Id like to use the same function
so that it is passed the div it is within and can find the appropriate
select box to populate...
.
- Follow-Ups:
- Re: getElementByName within containing DIV
- From: Joost Diepenmaat
- Re: getElementByName within containing DIV
- References:
- getElementByName within containing DIV
- From: DanWeaver
- Re: getElementByName within containing DIV
- From: Joost Diepenmaat
- getElementByName within containing DIV
- Prev by Date: Re: Very strange problem with Class object
- Next by Date: Re: getElementByName within containing DIV
- Previous by thread: Re: getElementByName within containing DIV
- Next by thread: Re: getElementByName within containing DIV
- Index(es):
Relevant Pages
|