Search the Community
Showing results for tags 'font awesome'.
-
In an html block on a Details datapage, I'm trying to show buttons with hyperlinks to social media pages using font awesome icons. The issue, though, is I need to show/hide these font awesome icons based on whether the datafield used for the url is null/blank or not. Basically, if the user has not entered a url link in the 'Facebook' field then I need to hide the Facebook font-awesome/hyperlink (because there is no url for Facebook for that record). I just want to show the social media links that have actual urls and hide those that don't. Here's the code to a couple of those hyperlinks (Facebook and LinkedIn- there are actually 6 in total but I didn't want to clutter this question). <div style="font-size:20px"><a href="[@field:myFacebookfieldname]" target="_blank"><i aria-hidden="true" class="fa fa-facebook-official"></i></a> <a href="[@field:myLinkedInfieldname]" target="_blank"><i aria-hidden="true" class="fa fa-linkedin-square"></i></a></div> For example, if [@field:myFacebookfieldname]=null then I need to hide (display:none) that hyperlink so it- the font awesome icon- doesn't show. I'm not a js expert so I hope someone here could help get this to work. Many thanks in advance. I was trying something like the below, to put the 'section1' attribute into the hyperlink above but that's not correct... <script> var v_fbook = parseFloat(document.getElementById("EditRecordmyFacebookfieldname").value); if(!isNaN(v_fbook)) { document.getElementById('section1').style.display = "block"; } else { document.getElementById('section1').style.display = "none"; } </script>
- 5 replies
-
- hyperlink
- font awesome
-
(and 1 more)
Tagged with: