Showing text box when field equals specific value

@bwprado hi there, thanks for responding.

This is a dynamic page which is navigated via a dropdown menu which is linked to the ‘number’ field of my dataset. The issue I am having is all to do with this part of the code:

function CreditTextShow () {
 let activeDynamicItem = $w('#dynamicDataset').getCurrentItem();
 let fieldX = activeDynamicItem['photoCredit'];
 if (fieldX && fieldX === "Joe Bloggs") {
 
        $w('#text488').show();
 } else {
        $w('#text488').hide();
 }

}

You are correct in what you have said about this previously.
Within the dataset there is a field called ‘Photo Credit’ and within this field it will either be blank or have the name of the person who has supplied a photo for my use. What I need is for the code to check against the currentItem to see if the name “Joe Bloggs” is in the ‘Photo Credit’ field of that item and if it is to show #text488 element on the page. I don’t really need the ‘else’ part of the statement as the text element is hidden on load anyway but it has become natural to include an else part.

As I say, the above code has worked in an old version of this page but having created a new version today it won’t work on the new page. If you could assist, it would be massively appreciated :slight_smile:

Thanks