cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Custom DateTime field and repeating sections.

Jump to solution

Since SP's DateTime control does not allow me to let the user specify anything non-date I use a text box and a jquery calendar control and set the constraint to false.Then just apply the CSS where needed. It works good except for in a repeating section.

NWF$('.DATEFIELD input').attr("placeholder", "mm/dd/yyyy").datepicker({ constrainInput: false });

The problem exists after you add a row. The calendar pops up and you can click the date but it does not populate the field. The Placeholder exists. But no date is populated. If I save and exit and go to the next row it works only if the row exists, just not after I click add row.

Any ideas?

Thanks.

Labels: (2)
Reply
1 Reply
Workflow Hero

Re: Custom DateTime field and repeating sections.

Jump to solution

Figured it out. I needed the RegisterRepeaterRowAdded event.

NWF.FormFiller.Events.RegisterAfterReady(function () {     NWF$('.DATEFIELD input').attr("placeholder", "mm/dd/yyyy").datepicker({ constrainInput: false });   
}
);

NWF.FormFiller.Events.RegisterRepeaterRowAdded(function (){

     var repeaterRow = NWF$(arguments[0][0]);
     
if(NWF$(repeaterRow.parents('.nf-repeater')[0]).hasClass('myrepclass'))      { 

                   NWF$('.DATEFIELD input').attr("placeholder", "mm/dd/yyyy").datepicker({ constrainInput: false });
         }
});

Thanks.

0 Kudos
Reply