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

Discussion

Discussion

How to Target the Table Add button using it's Class

posted on November 29, 2021 Show version history

I am able to Target the Add Button on a Table to hide it by using 

$('#q25').hide();

 

But I'd prefer to target if by Class if possible

I checked out the Inspect window and found it shows a class of

cf-table-add-row

Trying this by itself or with my Table class does not work.

$('.cf-table-add-row').hide();

$('.GLTable.cf-table-add-row').hide();

Any suggestions

Thanks

 

 

 

 

 

0 0
replied on November 29, 2021

$('.cf-table-add-row').hide(); should work. If not, something else might be going wrong in the code in which case I'd suggest looking for any JavaScript errors in the console.

However, if there's a chance you might have more than one table you should include the table class.

The problem with your second option is that you have the two classes together in the selector (no space) meaning it is looking for something with both of those classes.

You should have a space between them so it looks for something with the add row class within something with the GLTable class.

$('.GLTable .cf-table-add-row').hide();

You should be able to test these in the browser console to make sure they do what you want before you start modifying the form's JavaScript.

1 0
replied on November 29, 2021

All for the want of a space...

Thank you Jason, I will have hair for one more day smiley

0 0
replied on November 29, 2021

No problem!

The one that always gets me is putting a "." when I need a "#" and vice versa lol.

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

Sign in to reply to this post.