I have the below form and I would like to show error message on the form. so the users cannot save with proper email and phone# format.
Here is my vf :
<apex:page controller="Survey" sidebar="false" showHeader="false">
<apex:form id="SurveyForm" >
<apex:pageblock Title="Please fill the survey:">
<apex:pageBlockSection columns="2">
<apex:inputText value="{!account}" label="Account Name"/>
<apex:inputText value="{!contactNameTitle}" label="Contact Name & Title"/>
<apex:inputText value="{!phone}" label="Phone #"/>
<apex:inputText value="{!fax}" label="Fax #"/>
<apex:inputText value="{!email}" label="Email"/>
<apex:inputText value="{!website}" label="Website"/>
</apex:pageBlockSection>
<p><apex:commandButton action="{!save}" value="save" style="width:100px;"/></p>
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
<script src="/jquery/jquery.js"></script>
<script src="/jquery/jquery.validate.js"></script>
<script>
$(document).ready(function(){
$('surveyForm').validate({
rules: {
name: "required",
email: {
required: true,
email: true,
},
comment: "required"
}
});
});
</script>
</apex:page>