In a form i used i called a Javascript function. Though the function returns false , form is submitted and action method is called.
i used like this
<h:commandButton onclick="test();" action="{#bean.menthod}">
test- javascript method returns boolean value false.
Above doesnt work. Below mentioned code alone worked. I want to know why
<h:commandButton onclick="if(test) return true;else return false" action="{#bean.menthod}">