Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Javascript Manipulation of Struts SELECT

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?




 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
This tiny ad is guaranteed to be gluten free.
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic