Explanation
Hmm, your question is a bit... for the lack of a better word, "iffy". However, I understand what you want to do.
First of all, there is no need to put an input element inside the link when the link also responds to true/false. Second of all, you should NEVER put an input element inside a link.
It's just bad practice.
When you return false via Javascript to a link, the link will not navigate you further, just like the input element wont send you further when you return false from a submit.
This should suffice
<a href="#" onClick="return checkfhname()">Next</a>
If you'd rather want a button, just change it to a button, add a parameter for url, and use window.location = url
if you want it to navigate
<script>
function checkNavigate(url){
//check some conditions, conditions = false/true
if(typeof url == "undefined" || !conditions)
return false;
window.location = url;
return true;
}
</script>
<button onClick="checkNavigate('url')">Next</button>
Solution
Here's a JSFiddle example.
HTML
<div id="navigation">
<ul>
<li>
<a href="#link_clicked" onClick='return checkfhName();'>Link</a>
</li>
</ul>
</div>
Javascript
function checkfhName(){
//check your conditions, conditions = false/true
//for the purposes of this example: conditions = false
checkConditions = false;
if(checkConditions){
return true;
}
return false;
}
Additional information; good to know