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

Question

Question

Can't force collection click with javaScript code

asked on October 17, 2014

Hi everyone,

I used to code to add table row like:

$('#q18').trigger('click');

It' s work!,but 

I try to use this code with collection field to add a row,it doesn't work.

Did I do something wrong or there are any different way to code the collection field to be clicked with javaScript code.

Please suggest.

 

0 0

Answer

SELECTED ANSWER
replied on October 17, 2014

This doesn't work because #q18 doesn't just target your "add" button but rather the whole collection section. You'll need to drill down another level with you selector. I usually use the "class = " information visible on the CSS and Javascript page to help identify what to add to the selector. You should probably get the right result by using this:

$('#q18 .cf-collection-append').trigger('click');

 

1 0

Replies

replied on October 17, 2014

Hi Scott,

Thank you very much.

From your suggestion ,it works now.

appreciate help.

Bongkoch.

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

Sign in to reply to this post.