I want to know if is it possible to do the same javascript code with Jquery:
<input type="button" value="Save" onclick="javascript:return CheckPasswords()" />
What it does is return true or false on user click.
With Jquery I would write:
$(function()
{
$("#btnSalvar").click(function(){
if([...])
{
return false;
}
return true;
});
}
But i dont know in case return false it would have the same effect.
**UPDATED:**Solution is
$("btnSalvar").click(function(e){
if([...])
{
e.preventDefault();
}
});
thk you all!
it returning false should have the same result whether done in javascript or jquery
should operate the same way as your onclick event in jquery