AJPerformance Posted April 21, 2022 Share Posted April 21, 2022 Site URL: https://www.ajpgroup.com/contact-us Hi, I'd like to know if its possible to have the form field titles show inside the fields themselves until your start typing as shown in the picture below. And if possible, can someone show me how i can do it. Thank you! Link to comment
Beyondspace Posted April 21, 2022 Share Posted April 21, 2022 2 hours ago, AJPerformance said: Site URL: https://www.ajpgroup.com/contact-us Hi, I'd like to know if its possible to have the form field titles show inside the fields themselves until your start typing as shown in the picture below. And if possible, can someone show me how i can do it. Thank you! I think we can achieve it with some Js code to set placeholder for input element Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
AJPerformance Posted April 22, 2022 Author Share Posted April 22, 2022 14 hours ago, bangank36 said: I think we can achieve it with some Js code to set placeholder for input element im not very versed with Js so if you dont mind, can you help me figure it out please? Link to comment
Beyondspace Posted April 22, 2022 Share Posted April 22, 2022 29 minutes ago, AJPerformance said: im not very versed with Js so if you dont mind, can you help me figure it out please? You can try the following code in Home > Settings > Advanced > Code Injection, choose the footer <script> (function() { window.addEventListener('DOMContentLoaded', () => { const placeholders = document.querySelectorAll('.field'); if(placeholders.length) { placeholders.forEach(holder => { const inputEl = holder.querySelector('input, textarea.field-element'); const labelEl = holder.querySelector('.caption-text, .title').innerText; if(inputEl && labelEl) { inputEl.setAttribute('placeholder', labelEl); } }) } }); })() </script> Let me know how it works on your site AJPerformance 1 Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
Beyondspace Posted April 22, 2022 Share Posted April 22, 2022 My testing Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
AJPerformance Posted April 22, 2022 Author Share Posted April 22, 2022 2 hours ago, bangank36 said: You can try the following code in Home > Settings > Advanced > Code Injection, choose the footer <script> (function() { window.addEventListener('DOMContentLoaded', () => { const placeholders = document.querySelectorAll('.field'); if(placeholders.length) { placeholders.forEach(holder => { const inputEl = holder.querySelector('input, textarea.field-element'); const labelEl = holder.querySelector('.caption-text, .title').innerText; if(inputEl && labelEl) { inputEl.setAttribute('placeholder', labelEl); } }) } }); })() </script> Let me know how it works on your site It works perfectly, thank you bangank :))) Beyondspace 1 Link to comment
MaureenC Posted April 5 Share Posted April 5 I tried this but it still shows the fields above the box as well and not like the original image where the field description is only within the box. Is there a way to do this? Is there also a way to show more of a landscape option similar to image below, rather than it being completely vertical? Link to comment
tuanphan Posted April 8 Share Posted April 8 On 4/5/2023 at 8:36 PM, MaureenC said: I tried this but it still shows the fields above the box as well and not like the original image where the field description is only within the box. Is there a way to do this? Is there also a way to show more of a landscape option similar to image below, rather than it being completely vertical? Can you share link to this page? We can check easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment