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

Question

Question

Hiding the add button on a table

asked on June 6, 2019

I have a form with 2 tables on it and I am trying to hide the add row button for only one of them. 

I tried using   
       $('#q52').hide();   
and it didn't work.

The only things that I have found that do semi-work is adding 
       .cf-table-add-row {display:none !important;}
to the css, but that hides the add button on both tables. Alternatively i also tried
       $('#q52').remove(); 
that deleted the add button but also made the lookup stop working to autopopulate the rows

Does anybody know of a way i can hide just the one add button?

1 0

Answer

SELECTED ANSWER
replied on June 6, 2019 Show version history

Just looked at it on my side, and it looks like the add button has its own ID separate from the table. If you look at where it is in the preview from the CSS tab, you should see the following above where the add button is :

 

id="q4" class="cf-table-add-row form-q"

 

in this case, you should be able to use #q4 {display: none !important;}

2 0

Replies

replied on June 6, 2019

Another option is to select the "Append rows" option and set it to 0; this way the lookup will still add rows, but the user won't have the "Add row" option at all so no need for CSS or JavaScript.

6 0
replied on June 6, 2019 Show version history

Hi Josh,

 

Can you try:

#q52 .cf-table-add-row {
display:none !important;
}

I am assuming #q52 is the ID for your table?

1 0
replied on June 6, 2019

Yes thats the ID for my table. I tried that and it didn't work either. 

0 0
SELECTED ANSWER
replied on June 6, 2019 Show version history

Just looked at it on my side, and it looks like the add button has its own ID separate from the table. If you look at where it is in the preview from the CSS tab, you should see the following above where the add button is :

 

id="q4" class="cf-table-add-row form-q"

 

in this case, you should be able to use #q4 {display: none !important;}

2 0
replied on June 6, 2019

It does, in my case its #q51. I tried doing that as well and it didn't work either. 

Did it work when you tried it?

0 0
replied on June 6, 2019

Let me check the rest of my code, maybe there's something that's keeping it from working. When I loaded the form i noticed the add button was gone for a second and then popped up.

0 0
replied on June 6, 2019

Yes, I had a syntax error in the javascript that was effecting it. So that is working now. Thank you!

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

Sign in to reply to this post.