I am struggling with using javascript to reference a nested property that 
is 2 levels deep. I didn't seem to find anything on this topic that helped 
me when searching the archive list. Here is an example of my code that is 
NOT working because document.forms[0].myHidden does not exist (it's in a 
nested hierarchy).

JSP code:
<input type="checkbox" name="myCheckBox" onchange="if (myCheckBox.checked) 
{myHidden.value='true';} else {myHidden.value='false';}" />
<nested:hidden property="myHidden" />

HTML output code:
<input type="checkbox" name="myCheckBox" onchange="if (myCheckBox.checked) 
{myHidden.value='true';} else {myHidden.value='false';}" />
<input type="hidden" name="myFirstArray[0].mySecondArray[0].myHidden" 
value="true" />

When the nested:hidden tag is output to the browser, its reference is 2 
levels deep in the nested hierarchy. I don't know how to account for that 
in my conditional javascript statement (myHidden.value='true'). Also, the 
position could be dynamic (i.e. 
name="myFirstArray[3].mySecondArray[4].myHidden).

Thanks for any assistance!

Zach



-----------------------------------------
The information contained in this communication (including any attachments hereto) is 
confidential and is intended solely for the personal and confidential use of the 
individual or entity to whom it is addressed.  The information may also constitute a 
legally privileged confidential communication.  If the reader of this message is not 
the intended recipient or an agent responsible for delivering it to the intended 
recipient, you are hereby notified that you have received this communication in error 
and that any review, dissemination, copying, or unauthorized use of this information, 
or the taking of any action in reliance on the contents of this information is 
strictly prohibited.  If you have received this communication in error, please notify 
us immediately by e-mail, and delete the original message.  Thank you

Reply via email to