Accountability Posted October 18, 2018 Report Share Posted October 18, 2018 Contained in this HTML block are two options:Google Doc<br /> <a href="[@field:Employee_Document_Link]" target="_blank"><img alt="File Quick View" src="http://account-ability.net/webapps/hca/images/Entypo_e731(1)_32.png" style="width: 32px; height: 32px;" /></a><br /><br />Uploaded Doc<br /> <a href="https://c0axa147.caspio.com/dp/76292000e18ad3e841834930b209?Employee_Document_ID=[@field:Employee_Document_ID]" target="_blank"><img alt="File Quick View" src="http://account-ability.net/webapps/hca/images/Entypo_e731(1)_32.png" style="width: 32px; height: 32px;" /></a>The user clicks on either of the document icons. What I am trying to achieve is for the "Google Doc" icon to show only when the [@field:Employee_Document_Link] is not empty the and "Uploaded Doc" icon to only show when the [@field:Employee_Document_Upload] is not empty. Would very much appreciate any help in this. Quote Link to comment Share on other sites More sharing options...
Vitalikssssss Posted October 19, 2018 Report Share Posted October 19, 2018 Hi @Accountability, What is the datatype of these fields? 16 hours ago, Accountability said: [@field:Employee_Document_Link] 16 hours ago, Accountability said: [@field:Employee_Document_Upload] Thanks, Vitalikssssss Quote Link to comment Share on other sites More sharing options...
Accountability Posted October 19, 2018 Author Report Share Posted October 19, 2018 First of all thanks for responding. [@field:Employee_Document_Link] is a text255 and [@field:Employee_Document_Upload] is a file. Quote Link to comment Share on other sites More sharing options...
DefinitelyNot31337 Posted October 21, 2018 Report Share Posted October 21, 2018 Hello @Accountability, Assuming that you have a Report DataPage, just paste the snippet provided on an HTML Block with HTML Editor disabled in the Advanced Tab. (Important). If it is a Details DataPage just remove all occurences of -[@cbRecordIndex#], else, just paste as is. (Be sure to keep a backup before saving). <div id="googledoc-[@cbRecordIndex#]"> Google Doc <br /> <a href="[@field:Employee_Document_Link]" target="_blank"> <img alt="File Quick View" src="http://account-ability.net/webapps/hca/images/Entypo_e731(1)_32.png" style="width: 32px; height: 32px;" /> </a> <div> <br /> <br /> <div id="uploadeddoc-[@cbRecordIndex#]"> Uploaded Doc <br /> <a href="https://c0axa147.caspio.com/dp/76292000e18ad3e841834930b209?Employee_Document_ID=[@field:Employee_Document_ID]" target="_blank"> <img alt="File Quick View" src="http://account-ability.net/webapps/hca/images/Entypo_e731(1)_32.png" style="width: 32px; height: 32px;" /> </a> <div> <script> var googledoc = document.getElementById('googledoc-[@cbRecordIndex#]'); var uploaddeddoc = document.getElementById('uploadeddoc-[@cbRecordIndex#]'); if (![@field:Employee_Document_Link]) googledoc.style.display = "none"; if (![@field:Employee_Document_Upload]) uploaddeddoc.style.display = "none"; </script> What I did was, I just modified your whole HTML block. Wrapped the two links on separate div tags, then wrote a script that hides the link if the condition field is blank/empty. Hope this works and helps. Regards, DN31337 Quote Link to comment Share on other sites More sharing options...
Accountability Posted October 24, 2018 Author Report Share Posted October 24, 2018 Really appreciate you making the effort. Unfortunately didn't hide either one. This is an HTML block in a report results page. Thanks again for helping... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.