File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling a javascript function from java

 
sahana mithra
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I am facing a great problem in calling a javascript function

.java
sb.append(" <input type = 'checkbox' id ='chkBox' vallign='right' onClick='javascript:chkBox(this.selected)'> ");

.js
function chkBox(chkBox){
alert("selected" + chkBox);
}

When I click the checkbox, I dont get anything. How to make this work. Please help me
 
N Sahni
Ranch Hand
Posts: 55
Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Try modifying java code as:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic