Clear Field Values in Repeatable Sections with Javascript

Repeatable sections are a great way to give your user's the chance to enter multiple records based on the same child object, whether it's for a parent signing up multiple children for a camp or a business owner applying for multiple loans. As a default, repeatable sections retain information from the first object, but what if you want the data cleared each time? With Javascript, you can do this. 

Adding Javascript in Form Settings

While editing your form, click on the Form Settings button. Here, if you scroll down towards the bottom you can see a section called Javascript Code. Place the code listed below in the white box.




Code to Clear Values in Repeatable Section


function FF_OnAfterRender() {



function ClearNewRepeatableSection(elem) {

console.log("Clearing Repeatable Section");

/* clear out the values from text boxes of newly added section*/



// this line prevents picklists that are hidden from being cleared



return true;


function BindClickHandlers(){

$('.ff-sec-repeat-wrapper a.ff-add').unbind('click');

$('.ff-sec-repeat-wrapper a.ff-add').bind('click', function () {




$('.ff-sec-repeat-wrapper a.ff-remove').unbind('click');

$('.ff-sec-repeat-wrapper a.ff-remove').bind('click', function () {






Publishing Your Form

Once you have pasted the code, the Form Settings will save automatically. Exit the Form Settings and click "Publish Draft" to publish your form. When you navigate to your form, now if you click "+ Add Item", the information will clear!



Was this article helpful?
2 out of 3 found this helpful



Article is closed for comments.