function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Deepak ChouhanDeepak Chouhan 

Visualforce custom Validation

Hi All,
I trying to custom bootstrap form validation on VF page but it's not working.can any one help me. what am i mistake.

<apex:page docType="html-5.0" applyBodyTag="true" applyHtmlTag="true" showHeader="false" standardStylesheets="false">
<head>
        <apex:stylesheet value="{!URLFOR($Resource.customValidation,'validation/formValidation.min.css')}"/>
        <apex:stylesheet value="{!URLFOR($Resource.bootstrap_SFOne,'bootstrap-sf1/dist/css/bootstrap.css')}"/>
        <apex:includeScript value="{!URLFOR($Resource.wizard,'js/jquery-1.10.2.js')}"/>
        <apex:includeScript value="{!URLFOR($Resource.wizard,'js/bootstrap.min.js')}"/>
        <apex:includeScript value="{!URLFOR($Resource.customValidation,'validation/formValidation.min.js')}"/>
</head>
<body>
<apex:form id="frm">
    <apex:pageBlock >
        <apex:pageBlockSection >
            <apex:pageBlockSectionItem >
                <apex:inputtext html-name="fname" styleClass="form-control custom-input" value={!firstname}/>
                <apex:inputtext html-name="lname" styleClass="form-control custom-input" value="{!lastname}"/>
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
            <apex:commandButton value="save" action="{!save}"/>
            </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
<script type="text/javascript">
        $(document).ready(function(){     
            $('#frm').formValidation({
                framework: 'bootstrap',
                icon: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields:{
                    fname:{
                        validators:{
                            message:'first name is reuired'
                        }
                    },
                    lname:{
                        validators:{
                            message:'last name is reuired'
                        }
                    },
                }
            });
        });
    </script>
</body>
</apex:page> 
 
ShashankShashank (Salesforce Developers) 
Do you see any errors in the browser's javascript console when it fails to work? That should be a good place to debug javascript issues.