• 1
Aurora

Hide text in Footer

Question

Hi all !

 

Does anyone has a solution for this? 

 

I need to hide some text on the details page, when AuthField' value is not equal value from the Field#2. 

Merci!

 

Share this post


Link to post
Share on other sites

4 answers to this question

  • 0

Hi Aurora,

You may try using the following code in the footer of your details page. I wrapped text in a div with ID "Text"

<div id="text">Custom text</div>

<SCRIPT LANGUAGE="JavaScript">

function hide()
{
var x = '[@authfield:FIELNAME]';
var y = document.getElementById("EditRecordFIELDNAME#2").value;

if (x!=y){
document.getElementById("text").style.display="none";
}

}
window.onload=hide;
</SCRIPT>

Insert your authentication parameter instead of '[@authfield:FIELDNAME]'

also use your field name instead of "FIELDNAME#2"

Cheers!

Share this post


Link to post
Share on other sites
  • 0

Would there be a way to do this and hide results page fields?  I have a report that produces editable fields; but I want to set a rule that if an auth field is not equal to a field in the table, I want them to see but not be able to edit.

Worst case, I'd take just hiding the field all together...

 

EDIT: for clarity - instead of hiding by identifying the <div> I want to perform the function by identify a results field as seen in the picture.

Capture.JPG

Edited by SNMCStrategicSupport

Share this post


Link to post
Share on other sites
  • 0
On 2/4/2017 at 0:50 AM, SNMCStrategicSupport said:

Would there be a way to do this and hide results page fields?  I have a report that produces editable fields; but I want to set a rule that if an auth field is not equal to a field in the table, I want them to see but not be able to edit.

Worst case, I'd take just hiding the field all together...

 

EDIT: for clarity - instead of hiding by identifying the <div> I want to perform the function by identify a results field as seen in the picture.

Capture.JPG

I don't see an option to restrict editing on results page. For example inline edit links have the same class for each Id. 

As a workaround, we can compare info in auth field to field value and if those values are equal, we can provide a link to a separate details page, where you will be able to edit the record. 

Add an html block to your report, disable editor and paste the following script:

 

<script>
if ([@authfield:Field_name] ==[@field:Field_name]) {
document.write('<a href="URL_Of_details_page?ID=[@field:ID]">Edit record</a>');
}
</script>

 

Paste your fields instead of [@authfield:Field_name] and [@field:Field_name]

Also you need to paste your URL with parameter instead of: URL_Of_details_page?ID=[@field:ID]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now