aspose file tools*
The moose likes Struts and the fly likes Javascript Manipulation of Struts SELECT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Javascript Manipulation of Struts SELECT" Watch "Javascript Manipulation of Struts SELECT" New topic
Author

Javascript Manipulation of Struts SELECT

Siva Arun
Greenhorn

Joined: Feb 23, 2010
Posts: 28
I am having a dynamic table structure below.


productList is having Product objects. I need to take the price value (productUnitPrice) out of Product object and assign to the 'txtUnitPrice' text box based on the selected product. I have stuck with the below code. Can you help me to proceed further?





"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Why not just access the select box directly (use its "styleId" attribute) and grab its value and set it to the text box?

I'd *strongly* recommend using a JavaScript library like jQuery, Prototype, etc.

I'm also moving this to HTML and JavaScript as this seems to be more a JavaScript/DOM issue than Struts, at least once you use the styleId attribute.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript Manipulation of Struts SELECT