3

I want to show a date-picker on a public site(Force.com site).I am updating Opportunity records using some variables from force.com site.But how to show a date field..

I have tried this its showing fine in VF page but it is not showing a pop calender on Force.com sites.

<apex:inputText size="10" id="queryDate" onfocus="DatePicker.pickDate(false, this, false);"/>

Can someone help with me with this..how to show a date pop calendar on sites so i can take the input and save that in Salesforce..

1
  • Do you have standard stylesheet=false in sites ?If thats the case that approach wont work Commented Apr 30, 2014 at 4:57

1 Answer 1

4

How about:

<apex:input value="{!myDateVar}" type="date"/>
5
  • At least on modern browsers. Older browsers need a JavaScript function/library.
    – sfdcfox
    Commented Apr 30, 2014 at 2:58
  • 1
    I tried this is working in chrome and but not on firefox...:(:( Is there any other way i can do this...?
    – miku
    Commented Apr 30, 2014 at 3:20
  • If you are binding to an SObject field in you controller you can just go: <apex:inputField value="{!someDateFieldOnOpportunity}"/> Commented Apr 30, 2014 at 3:27
  • Hey Luke.Yes we can do that on VF page..but on force.com site it doesn't show up as input field as we can't update standard object..on public site..as it doesn't have edit permission but i have created variables to update opportunity...i dont know how to show date as input field on force.com site...
    – miku
    Commented Apr 30, 2014 at 3:40
  • Hmmm now I follow. In the past I have used a 'dummy' Contact in my controller just so that I can bind an inputField to myContact.Birthdate. I wonder if you could do something similar, and then just pull the Contact Birthdate value out and use to update the Opportunity? I guess it wouldn't need to be a Contact, could even be an Opportunity and the same field that you are using? Commented Apr 30, 2014 at 4:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .