Javascript message in visualforce page

<apex:page standardController="Employee__c" >
<apex:form >
<apex:pageBlock title="Custom objectdetails">
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}" onclick="return validate()"/>
<apex:commandButton value="Cancel" action="{!Cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlocksection title="Fill the data" collapsible="True" >
<apex:inputField value="{!Employee__c.Name}"/>
<apex:inputField value="{!Employee__c.Email__c}"/>
<apex:inputField value="{!Employee__c.Phone__c}"/>
<apex:inputField value="{!Employee__c.EmpId__c}"/>
<script>
function validate(){
window.alert('data is saved');

}
</script>


</apex:pageBlocksection>
</apex:pageBlock>

</apex:form>
</apex:page>

Comments