telly Posted April 17, 2019 Report Share Posted April 17, 2019 Hi- Is there a way to format the text in the text field on the DataPages? I want formats: - Color (change to red) - Font Text (calibri) - Font weight(Bold) Here is the test Deployed DataPage: https://c0dcv045.caspio.com/dp/aa4a60002c0e5edfe68e415eadb7 Quote Link to comment Share on other sites More sharing options...
SunakoChan Posted April 17, 2019 Report Share Posted April 17, 2019 Hi- Try this code on your DataPage just paste it on your DataPage Header(note: disable first the html editor before pasting the CSS). <style> .cbFormTextField{ color: #f90a0a !important; font-family: Calibri !important; font-weight: bold !important; } </style> Note: Please change the color base on what you prefer. Expected result: https://c0acs764.caspio.com/dp/ba4a60009a119570a12e4c478dc4/files/3139800 Hi- Try this code on your DataPage just paste it on your DataPage Header(note: disable first the html editor before pasting the CSS). <style> .cbFormTextField{ color: #f90a0a !important; font-family: Calibri !important; font-weight: bold !important; } </style> Note: Please change the color base on what you prefer. Expected result: https://c0acs764.caspio.com/dp/ba4a60009a119570a12e4c478dc4/files/3139800 Quote Link to comment Share on other sites More sharing options...
SunakoChan Posted April 17, 2019 Report Share Posted April 17, 2019 Hi- You can also customize the DataPage, just go to Style> Source>All. Then search for the .cbFormTextFiel, after that, you can change the color, font-family, and font weight. You don't need to add !important: https://howto.caspio.com/styles/customizing-styles/. Quote Link to comment Share on other sites More sharing options...
Kurumi Posted January 31, 2023 Report Share Posted January 31, 2023 Hi! Just sharing this tip. You can also use Font icons such as Font Awesome for labels. To apply in the DataPage, follow these steps: 1. Insert Header and Footer. In the Header, insert the installation CDN <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/js/all.min.js"></script> 2. Search your icon here: https://fontawesome.com/v5/search?o=r&m=free&s=solid 3. Copy code snippets such as <i class="fas fa-users"></i> 4. Paste the code in Labels or any HTML code where you like to add an icon. Sample Result: References: - https://fontawesome.com/ - https://cdnjs.com/libraries/font-awesome Quote Link to comment Share on other sites More sharing options...
Kurumi Posted June 30, 2023 Report Share Posted June 30, 2023 Hi! In addition to having Font icons such as Font Awesome for labels, you can also apply this in the Header in the Results Page of Report DataPage. To apply in the DataPage, follow these steps: 1. Insert Header and Footer. In the Header, insert the installation CDN <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/js/all.min.js"></script> 2. Search your icon here: https://fontawesome.com/v5/search?o=r&m=free&s=solid 3. Copy code snippets such as <i class="fas fa-users"></i> 4. Paste the code in Labels in the Header where you like to add an icon. Result: Quote Link to comment Share on other sites More sharing options...
Kurumi Posted September 29, 2023 Report Share Posted September 29, 2023 Hi - Just an update, for dynamically changing the font color of field values based on a condition - you can use this solution/CSS: https://howto.caspio.com/tech-tips-and-articles/dynamically-changing-colors-of-values/ Quote Link to comment Share on other sites More sharing options...
futurist Posted November 20, 2023 Report Share Posted November 20, 2023 Just to add, if you also wish to validate value entered in an input field to make sure that it follows this format: www.websitename.com Then you can use this code: <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function(event) { var inputField = document.querySelector('#InsertRecordNameofField'); const value = inputField.value; const regex = /^www\.[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/; if (!regex.test(value)) { event.preventDefault(); alert('Invalid Submission!'); } else { document.form["caspioform"].submit(); } }); </script> Make sure to replace "NameofField" with the actual name of the field that you want to validate before submitting. 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.