Angela1980 Posted May 26, 2020 Share Posted May 26, 2020 HI everyone I can't seem to find anywhere to remove the the last name field on the newsletter form block? I only want to ask for people's FIRST name and email, NOT their last name, and not just their email. There seems to be no option for this. Would this be a coding thing? I hope not..... AsiaForum 1 Link to comment
tuanphan Posted May 27, 2020 Share Posted May 27, 2020 You can't remove Last name field unless using JavaScript (Need a Business Plan). If you use Business Plan, you can share link to page where you use newsletter block, I can take a look. 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
taylorlaidlaw Posted August 8, 2020 Share Posted August 8, 2020 Hi Tuan, How do I delete the last name field on all of the newsletter blocks on this site? https://grape-gerbil-aby9.squarespace.com/ password: hustle Thank you!! Link to comment
tuanphan Posted August 11, 2020 Share Posted August 11, 2020 On 8/9/2020 at 12:52 AM, taylorlaidlaw said: Hi Tuan, How do I delete the last name field on all of the newsletter blocks on this site? https://grape-gerbil-aby9.squarespace.com/ password: hustle Thank you!! Add to Page Settings > Advanced > Header <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> const lnames = document.querySelectorAll('.last-name input') const lnameFields = document.querySelectorAll('.last-name') $(document).ready(function(){ lnames.forEach(lname => { lname.value = "-" }) lnameFields.forEach(lnameField => { lnameField.style.display = "none" }) }); </script> 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
BXDesign Posted February 9, 2022 Share Posted February 9, 2022 Hello @tuanphan, Just used your script to remove the last name on a newsletter form and it worked perfectly! Is there any way to tweak it so it doesn't affect a regular contact form where the last name could be required? Thank you so much :) Link to comment
tuanphan Posted February 14, 2022 Share Posted February 14, 2022 On 2/10/2022 at 12:30 AM, BxDesign said: Hello @tuanphan, Just used your script to remove the last name on a newsletter form and it worked perfectly! Is there any way to tweak it so it doesn't affect a regular contact form where the last name could be required? Thank you so much :) try this new code <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> const lnames = document.querySelectorAll('.newsletter-block .last-name input') const lnameFields = document.querySelectorAll('.newsletter-block .last-name') $(document).ready(function(){ lnames.forEach(lname => { lname.value = "-" }) lnameFields.forEach(lnameField => { lnameField.style.display = "none" }) }); </script> pandora23, sayreambrosio, BXDesign and 1 other 1 2 1 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
BXDesign Posted February 26, 2022 Share Posted February 26, 2022 On 2/14/2022 at 2:29 PM, tuanphan said: try this new code <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> const lnames = document.querySelectorAll('.newsletter-block .last-name input') const lnameFields = document.querySelectorAll('.newsletter-block .last-name') $(document).ready(function(){ lnames.forEach(lname => { lname.value = "-" }) lnameFields.forEach(lnameField => { lnameField.style.display = "none" }) }); </script> Worked perfectly, thank you so much 🙂 pandora23 1 Link to comment
pandora23 Posted December 29, 2022 Share Posted December 29, 2022 (edited) Hello @tuanphan — I am so grateful to you for posting a solution to specifically remove the last name field and last name input from the newsletter only, not anything else. THANK YOU. 🙌 Edited December 29, 2022 by pandora23 tuanphan 1 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