Master Posted August 25, 2017 Report Share Posted August 25, 2017 I want to be able to hide a set of fields and show upon click on a list report. How can I do that since we do not have Rules in result page. Quote Link to comment Share on other sites More sharing options...
MayMusic Posted August 25, 2017 Report Share Posted August 25, 2017 Add a header to your page and use the code below: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> Add HTML Block above all the elements that needs be hidden, uncheck HTML Editor in advanced tab and use the code below to create buttons and start the block that needs to be hidden <input type="button" href="#" id="s[@field:ID]" Value="Show" /> <div id="b[@field:ID]"> <input type="button" href="#" id="h[@field:ID]" Value="Hide" /> At the end of the elements add another HTML Block, uncheck HTML Editor and paste this code </div> <script> $(document).ready(function(){ $('#b[@field:ID]').hide(); $('#h[@field:ID]').click( function (){$('#b[@field:ID]').hide();$('#s[@field:ID]').show();}); $('#s[@field:ID]').click( function (){$('#b[@field:ID]').show(); $('#s[@field:ID]').hide();}); }); </script> Note [@ID] in this code needs to be replaced with the unique ID you have in your table source. vikovs 1 Quote Link to comment Share on other sites More sharing options...
zalipresents Posted September 1, 2017 Report Share Posted September 1, 2017 MayMusic, How do I take this script and make it display on the value of an a field? I need this button to hide if the field "Day Type" is not equal to "Gig"...where can that be inserted into the code? Quote Link to comment Share on other sites More sharing options...
MayMusic Posted September 6, 2017 Report Share Posted September 6, 2017 If you want to hide a field if the value is not equal to Gid then you need to Add a header to your page and use the code below: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> add the code below above the conditional field in a HTML Block: <div id="b[@field:ID]"> And this code below in HTML Block: </div> <script> $(document).ready(function(){ if ("[@field:Day_Type]" != "Gig"){ $('#b[@field:ID]').hide(); }}); </script> Make sure you have unchecked HTML Editor in advanced tab for header and HTML Blocks Quote Link to comment Share on other sites More sharing options...
zalipresents Posted September 8, 2017 Report Share Posted September 8, 2017 May Music, Works great on a list, how do I get this same function to work on a calendar datapage? Quote Link to comment Share on other sites More sharing options...
zalipresents Posted September 11, 2017 Report Share Posted September 11, 2017 Also...how do you get this script to work for multiple sections? What I'm looking to do is have different sections that display the fields in those sections when the user clicks on the name of the section. The code provided works for one section, but when I try to use it for multiple sections on a list datapage, it only works for the first section...all others fail to open/close. 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.