Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

calling a javascript function from java

 
sahana mithra
Ranch Hand
Posts: 72
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Try modifying java code as:
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!