Hi, I have created a members profile page and would like my members name to always display as all caps no matter what the case is in the database. I tried doing it in the text edit but there is no option for all caps. I can see if I use an all caps font this will work but font doesn’t work with my overall design. So how do I get it to change my chosen font to be in all caps for the title/name. Thank you for helping a total newbie:)
Hi,
You can do it with a bit code:
Instead of connecting the element to the collection using the editor, you should add the following function to your page code section:
$w.onRender(function () {
//getting current item from the collection
let currentItem = $w('#dynamicDataset').getCurrentItem();
//change the text to upper case.
$w('#elementID').text = currentItem.fieldName.toUpperCase();
});
Click here to learn more about the toUpperCase function.
Have a good day,
Tal.
Hi
thank you Tal. Unfortunately its not bringing in the text from the database not.
the error I get on preview is:
TypeError: $w(…).getCurrentItem is not a function
Hi,
Have you checked that the ID of the dataset is the same as the code written? Are you sure that this is a dynamic page ?
Tal.