Search the Community
Showing results for tags 'return false'.
-
Hi, Im trying to run the showPic function without putting any JS into HTML(when i used onclick = showPic() return false, it worked fine). I added prepareGallery function for this reason and I cant get it working. I think I can see it changes the pics but link will be executed also. Anyone got an idea where I made the mistake? <body><h1>Snapshots</h1><ol id="links"><li><a href="benfica.jpg" title="benfica">Benfica</a></li><li><a href="yamaha.jpg" title="yamaha">Yamaha</a></li><li><a href="island.jpg" title="i
-
I am not so experienced in js and as such I have this question;Here is some code: $(function() { $('.error').hide(); $(".button").click(function() { $('.error').hide(); var name = $("input#name").val(); if (name == "") { $("label#name_error").show(); $("input#name").focus(); return false; } // validate and process form here }); }); Why the if statement above has a "return false" statement in it.Is there a difference in the false statement between PHP and JS.