Conditional redirect a page using javascript

Conditional redirect a page using javascript

Hi,
 
I have the following page:
I am expecting nothing happening when the button is clicked because it has a "return false" statement, but it returns a page saying "false".
 
How do make the function do nothing on certain conditions?
 
Thanks