File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts and javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts and javascript" Watch "Struts and javascript" New topic
Author

Struts and javascript

Muthukrishnan Manoharan
Ranch Hand

Joined: Aug 27, 2008
Posts: 91

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

Joined: Sep 29, 2008
Posts: 12617

Have you examined the HTML emitted by the Struts tags?
Muthukrishnan Manoharan
Ranch Hand

Joined: Aug 27, 2008
Posts: 91

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

Joined: Sep 29, 2008
Posts: 12617

The "styleId" attribute renders an HTML "id" attribute.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts and javascript