Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts and javascript

 
Muthukrishnan Manoharan
Ranch Hand
Posts: 91
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can any body please tell me how can i access HTML elements created using struts tags in javascript. For example,


So in functions add() and remove() how will I access the drop down items being selected..
If it is using document.getElementById(id), what is the id value I can use there..

Or does struts provide any javascript extensions, (as it provides for javascript validator plugin) that will make our javascript coding easier.

Thanks,
Muthu
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you examined the HTML emitted by the Struts tags?
 
Muthukrishnan Manoharan
Ranch Hand
Posts: 91
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah I can find only the name attribute for the elements. I dont get the id attribute.. And the <html:select> or any other struts tag doesnt seem to support id attribute..

I will be much interested if there are any natural support provided by struts for javascript like <html:javascript/>. If not how can one access the DOM elements using document.getElementById()

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "styleId" attribute renders an HTML "id" attribute.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic