Hello,
using the tag apex:actionFunction(A component that provides support for invoking controller action methods directly from JavaScript code using an AJAX request. An component must be a child of an component.)
for an exaple :-
Controller:-
public class controller{
public pageReference noiseSearch(){
//logic
return null;
}
}
vf page:-
So your button will be
<apex:commandButton value=”Search” onclick=”check();” reRender=”nPbt” />
And your script function
function check(){
var user = document.getElementById(‘pg:frm:nPB:ip’).value;
if(user == ”){
alert(‘Please Enter noise Name before Proceeding.’);
return true;
}
else
noiseSearchAF();
return true;
}