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..

  • Do you have standard stylesheet=false in sites ?If thats the case that approach wont work – Mohith Shrivastava Apr 30 '14 at 4:57
4

How about:

<apex:input value="{!myDateVar}" type="date"/>
  • At least on modern browsers. Older browsers need a JavaScript function/library. – sfdcfox Apr 30 '14 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 Apr 30 '14 at 3:20
  • If you are binding to an SObject field in you controller you can just go: <apex:inputField value="{!someDateFieldOnOpportunity}"/> – luke.mcfarlane Apr 30 '14 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 Apr 30 '14 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? – luke.mcfarlane Apr 30 '14 at 4:52

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.