Home › Forums › Classic DFFS › HTML Table not showing when using Side-by-side
- This topic has 4 replies, 2 voices, and was last updated 2 years, 8 months ago by Alexander Bautz.
-
AuthorPosts
-
-
February 17, 2022 at 23:27 #35571
Hello Alexander,
I’m using DFFS 4.4.5.4, and trying to hide an HTML table in a side-by-side section in our rules until a selection is made.
The rest of our fields hide and show correctly, but the HTML fields don’t show when the rule is triggered.
When I inspected the page I could see the section was loading, but it wasn’t visible.
I removed the SBS index from the field and confirmed this was stopping it.I’ve hit a bit of a wall with where to go from here, is there a way I can make the section show?
Thanks
-
February 17, 2022 at 23:45 #35572
I found it was because the style isn’t being removed for the HTML field, as in the attachment.
I got around it by removing the style via jQuery in the Custom JS, but I’m sure there’s a better way
function removeStyle(){
var sbsTable = document.getElementById(“sbs_Field_dffsHTML_charity_test2_1”);
var sbsTable1 = document.getElementById(“sbs_Field_dffsHTML_charity_test_1”);
var sbsTable2 = document.getElementById(“sbs_Field_dffsHTML_charity_test3_1”);
jQuery(sbsTable1).removeAttr(“style”);
jQuery(sbsTable2).removeAttr(“style”);
jQuery(sbsTable).removeAttr(“style”);
}Attachments:
-
February 17, 2022 at 23:53 #35574
better script:
function removeStyle(){
var sbsTable = document.querySelectorAll(‘[fieldtype=dffs_html’);
jQuery(sbsTable).removeAttr(“style”);
} -
February 18, 2022 at 00:17 #35575
Disregard my edit, that broke the tabs.
-
March 15, 2022 at 18:04 #35613
Hi,
Sorry for not replying – the email notification on my site broke after an update and I didn’t catch your question.How did you try to show / hide the HTML section in your rule?
If you want it hidden initially you can set up a rule triggering on “The form is initiated” and add the HTML Unique ID to the “Hidden headings or elements” textarea.
Then, on the rule triggering on your selection, you add the same Unique ID to the “Visible headings or elements” textarea.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.