This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
multibox disabled but checked
How to Uncheck the checkbox
How to use the Java variable inside the Javascript function
Cannot submit unchecked checkbox to Controller.
DOM - Want to set functio nane for onClick attribute