How do I access nested property of Struts HTML Form from javascript?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aamir_Sehbai
Posted On:   Wednesday, June 28, 2006 05:02 PM

My struts form contains a user object which in turn contains an Order object. My HTML form looks something like: Is there any way possible to access the property orderId from javascript on the client side? I tried: function showOrderId() { alert("orderId is: " + document.OrderForm.user.order.orderId); } ]]>]]> but this is not working. While document.OrderForm does contain the form object and if there are any properties defined at this level, I can access them easily, is there any way I can access the nested properties from Javascript too?    More>>

My struts form contains a user object which in turn contains an Order object. My HTML form looks something like:


			






Is there any way possible to access the property orderId from javascript on the client side? I tried:


			



but this is not working.


While document.OrderForm does contain the form object and if there are any properties defined at this level, I can access them easily, is there any way I can access the nested properties from Javascript too?

   <<Less

Re: How do I access nested property of Struts HTML Form from javascript?

Posted By:   Aamir_Sehbai  
Posted On:   Wednesday, July 12, 2006 02:22 PM

Okay, I found out how to achieve this by using a slightly different notation. The following works:



Re: How do I access nested property of Struts HTML Form from javascript?

Posted By:   Christopher_Koenigsberg  
Posted On:   Saturday, July 8, 2006 02:01 PM

maybe try





and then I think you can do


alert("OrderId is: " + document.getElementById(orderId))

About | Sitemap | Contact