• #66264
    Salesforce | Nikita Nikita #3
    Forcetalks

    How to get standard date picker custom Visualforce in Salesforce?

    Hi All,

    In custom VF page have to display date fields with date picker, how can i write code for this ?

    there is no standard controller, on custom controller is there for page.

    Thanks

     

    #66323
    Salesforce | Deepak Deepak #4
    Forcetalks

    Please find the below examples to display the date field with date pickers.

    Ex 1 :
    Visual Force Page :
    <apex:page docType=”html-5.0″ controller=”Sample”>
    <apex:form >
    <apex:pageBlock >
    <apex:pageBlockSection>
    <apex:pageBlockSectionItem>
    Date: <apex:input type=”date” value=”{!dat}”/>
    </apex:pageBlockSectionItem>
    </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
    </apex:page>

    Apex Controller :
    public class Sample {
    public Date dat {get;set;}
    public Sample() {

    }
    }

    Ex 2 :
    Visual Force Page :
    <apex:page controller=”datePicker” id=”mypage”>
    <apex:form>
    Date: <apex:inputText value=”{!datename}” size=”10″ id=”demo” onfocus=”DatePicker.pickDate(false, this , false);” />
    </apex:form>
    </apex:page>

    Apex Controller :
    public class DatePicker
    {
    public String datename {get; set;}
    }

Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2020 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?