Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

handling onclick

 
mou haj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cant I DO onclick on an image... in netscape.. Ican do that in IE
then... how will i call a function from a button....If I call thriugh href then if there is return false in the javascript function..the code is not working
please help
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do something like this. It works in both Netscape and IE.
<A href="javascript:void 0" ONCLICK="yourFunctionName();return false;">

Bosun
 
mou haj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx a lot Bouson.... I found out another way ... instead of writing return false if you only write return it works... return true and return false are only required if you want to specifically capture them... simply mentioning return means coming out of function
 
A1ien51 CNEUFOs
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello there
here is a quick answer to the above
for the button
<input type="button" onclick="funcname()" name="hm" value="Click">
for the link, three ways
<a href="javascript nclick="funcname()">hmmmm</a>
<a href="javascript:void(0);" onclick="funcname()">hmmmm</a>
<a href="# onclick="funcname()">hmmmm</a>

hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic