ppbb123 Posted February 20, 2015 Report Share Posted February 20, 2015 Hi, I use this method to display the last 4 characters in a result column . In a HTML Block: <script> var str = "[@field:area]"; // get the value of area field var res = str.slice(-4); // get the last four characters of area field document.write(res); // display </script> How to display the same thing in details page? I cannot use HTML Block because the style looks different. Quote Link to comment Share on other sites More sharing options...
HongTaiLang Posted February 20, 2015 Report Share Posted February 20, 2015 If the field is "Display Only", the value will be displayed around <span> tags. You can get the value by span tag and replace it. <script> var col = document.getElementsByTagName('span'); var x = col[1].innerHTML; // if the field is second "Display Only" field on that page col[1].innerHTML = x.slice(-4); </script> 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.