0

I am trying to create a form using VF but I am getting old style button so I have tried styleClass attribute but it is not working

Visualforce Code:

<apex:page standardController="Contact" >
    <apex:form > 
        <apex:pageBlock title="Edit Contact">
            <apex:pageBlockSection columns="1">
                <apex:inputField value="{!Contact.FirstName}"/>
                <apex:inputField value="{!Contact.LastName}"/>
                <apex:inputField value="{!Contact.Email}"/>
                <apex:inputField value="{!Contact.Birthdate}"/>
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton styleClass="slds-button" action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>

So can some one help to add new style to button and if possible then any reference link.

Thanks

1 Answer 1

1

For this use case Salesforce made available the Lightning Experience Stylesheets. If you change the <apex:page> tag to:

<apex:page standardController="Contact" lightningStylesheets="true">

it should work.

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/vf_dev_best_practices_slds_lightningstylesheets.htm

2
  • It works but now I am not able to see datepicker for Birthday Jul 8, 2019 at 11:47
  • @MysteriousCoder If you have separate follow-up issues, please open a new question, and consider accepting Theodoor's answer if it solved this issue.
    – David Reed
    Jul 8, 2019 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.