I've this simple VF page, which is populating today's date on change of value of Picklist(Active__c field as mentioned below): This is done with help of action function which refreshes an outputText. But it is not working. its gives error : Visualforce Error Help for this Page
The name can only contain underscores and alphanumeric characters. It must begin with a letter and be unique, and must not include spaces, end with an underscore, or contain two consecutive underscores. Does using extention anything to do with it?
<apex:page standardcontroller="Account" extensions="RefeshCon">
<script type = "Text/Javascript">
function PopulateDate()
{
alert('hi');
ActPopulateDate();
}
</script>
<apex:form >
<apex:ActionFunction name="ActPopulateDate" action="{!populatedateviaCont}" reRender="Refreshdate" />
<apex:pageblock >
<apex:pageblockSection >
<apex:inputField value="{!Account.Name}" />
<apex:inputField value="{!Account.Active__c}" onchange="PopulateDate()" />
<apex:outputText value="{!d}" id="Refreshdate" />
</apex:pageblockSection>
</apex:pageblock>
</apex:form>
</apex:page>
This is my controller
public class RefeshCon {
public datetime d {get;set;}
public RefeshCon(ApexPages.StandardController controller) {
}
public pagereference populatedateviaCont() {
d = system.now();
return null;
}
}