File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Java script in struts tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Java script in struts tags" Watch "Java script in struts tags" New topic

Java script in struts tags

Asheesh Nehra
Ranch Hand

Joined: Jun 25, 2009
Posts: 35

I am trying to call a java script function on change in struts html tags as

but function could not be called. if I call this function in other than struts tags like

, then it works fine what is problem in struts . Thanks
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

Asheesh Nehra wrote:

When you see this tag on your browser, just look at the generated HTML code for the same and find out anything that messing up with the JS call.

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Santhosh Reddy

Joined: Sep 25, 2006
Posts: 27
<html:select property="inspection" style="width:150px" onClick="inspection();" >
Asheesh Nehra
Ranch Hand

Joined: Jun 25, 2009
Posts: 35
Thank you all for the reply but struts-html.tld define onclick instead of onClick ???
David Newton

Joined: Sep 29, 2008
Posts: 12617

As the previous commenter suggested, check the rendered HTML.
I agree. Here's the link:
subject: Java script in struts tags
It's not a secret anymore!