function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
❤Code❤Code 

How to insert dynamically created dates from vf page

Hi All,

Can anyone tell me how to insert dynamically created dates fields from vf page. 

Below is a sample from jsfiddle.

http://jsfiddle.net/swm53ran/331/

Regards
karthikeyan perumalkarthikeyan perumal
Hello,

use below Class and apex page to  add dates dynamically  use This " dat "variable to insert in controller
Apex class: 
 
public class TestDate
{
public List<Integer> counterId{get;set;}
List<SelectOption> options{get;set;}
public Date dat {get;set;}
public Test(ApexPages.StandardController controller)
{}
public Test()
{

counterId = new List<Integer>();
counterId.add(1);
}
public PageReference addFilter()
{
counterId.add(1);
return null;
}

}

VF page:
<apex:page controller="TestDate" docType="html-5.0" standardStylesheets="false">
<apex:form >
<apex:pageBlock id="thPB" >
<apex:commandButton value="Add New Row" action="{!addFilter}" reRender="thPB"/>
<apex:pageBlockSection >
<apex:repeat var="filter"  value="{!counterId}">
Date :<apex:input type="date" value="{!dat}"/>  
</apex:repeat>
</apex:pageBlockSection>

</apex:pageBlock>

</apex:form>
</apex:page>

Hope this will help you. 
Mark Best ANSWER if its work for you. 

Thanks
karthik


 
❤Code❤Code
Hi KArthik,

I have created a page which adds date field dynamilcally by Jquery. Can you check and let me know hoow to do the insert ..I have posted the question in salesforce stackexchange.


http://salesforce.stackexchange.com/questions/144289/how-to-insert-dynamically-created-dates-from-vf-page?noredirect=1#comment209544_144289

Regards