Hi friends,
I want to hide some elements of a form at particular situations. In IE, I put the elements in a <div>. By setting the div's style, I can successfully hide them. But in NS4, it doesn't work. Then I just put the whole <form> in a <div>. The hiding and showing work well, but when I access the elements in Javascript, there seems be something wrong.
For example, the form's name is form1, the div's id is div1 and the elements are text1 and hidden1.
In the Javascript code, the following cases work well in different cases:
[1] document.form1.elements["text1"].value = "sometext1";
document.form1.elements["hidden1"].value = "sometext2";
[2] document.div1.document.form1.elements["text1"].value = "sometext1";
document.div1.document.form1.elements["hidden1"].value = "sometext2";
I don't know the reason why sometime [1] works but [2] doesn't, sometime [2] works but [1] doesn't.
Can anybody tell me which one is correct way to access the form elements surrounded by div in NS4. Why the elements seems accessable/unaccessable in different occasions.
Thanks a lot.