You are viewing limited content. For full access, please sign in.

Question

Question

Unable to run Jquery on any rows after the first in a Forms Data collection

asked on February 16, 2017

Hi,

I have used a dropdown to populate a list of names and emails inside a collection rather than a table. What I want to do is copy the contents of the collection row prior to its deletion.  When i place an event on the  ".cf-collection-delete" it only seems to work for the first row.

 

Below is just a simple event test but it only seems to work for the first row.

$(".Section_Assign .cf-collection-delete").on("click", function(){
     alert("Clicked");
  });

Is there something I am missing?

Cheers

 

 

0 0

Answer

SELECTED ANSWER
replied on February 16, 2017

Hi Mark,

The jquery script you wrote only listens for clicks on the ".cf-collection-delete" button that already exist on the form on load. It is not listening for when you add additional rows. Change your script to: 

$(".Section_Assign .cf-collection").on("click", ".cf-collection-delete", function(){
	alert("Clicked");
});

 

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.