aspose file tools*
The moose likes Java in General and the fly likes calling a javascript function from java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "calling a javascript function from java" Watch "calling a javascript function from java" New topic
Author

calling a javascript function from java

sahana mithra
Ranch Hand

Joined: Oct 26, 2010
Posts: 72
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

Joined: Jul 07, 2011
Posts: 55

Hi,
Try modifying java code as:


Thanks and Regards,
Nilesh Sahni | nsahni@infocepts.com | www.infocepts.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calling a javascript function from java
 
Similar Threads
DOM - Want to set functio nane for onClick attribute
multibox disabled but checked
Cannot submit unchecked checkbox to Controller.
How to use the Java variable inside the Javascript function
How to Uncheck the checkbox