Thanks cLFlaVA, but I think you misunderstood what I want to acomplishe. I admit, that my description and also english aren't the best, but maybe read the frist post again. I try to write a more complete example that is suppoused to add an additional input field to the same form where element...
Thanks for that hint. But what if the form has no specified id value? Like this:
<form>
<input name="test" id="test" value="Form 1 value" />
</form>
<form>
<input name="test2" id="test2" value="Form 2 value" />
</form>
How could I detetct the form in that case? I guess I need to find out...
Say I have multiple forms in my page and also multiple elements in each form. Now I need this: I know an element's id and I want to get the form's id the element is in.
Background: I need this to be able to dynamically add elements (hidden fields) to the same form that the desired element is...
Somehow I thought I can't set onLoad in body, because the body is already loaded when the code reaches to the point I'm tring to set onLoad . Abviously thats not the case and ofcourse I can set onLoad in body... So I used the function described in this FAQ and it seems to work just fine...
The problem: I need to dynamically assign some params for elements (input fields) on a page when it loads. But I can't do it before the elements are actually there (page has been loaded).
I can't use window.onLoad or <body onLoad="func();"> because I have no access to the <head> part of pages...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.