Hi,
I want to do validation.When i click the commandbutton some validation should be done here.depending on that the action should be done.But if the function is returning false also the the form is calling the backing bean.I should stop that action if the function return false.
Is this the correct way
function check()
{
var value=document.getElementById('form:field1').value;
if(value=="")
{
alert('Please select an event to edit');
return false;
}
else
{
return true;
}
}
===================
h:commandButton value="Edit" action="#{bean.method}"
onKlick ="javascript:check();"