Benny_S Posted May 13, 2021 Share Posted May 13, 2021 (edited) Site URL: https://www.effektfootwear.com/signup Hi all. I have been scouring the web to figure this one out, found my way here, but cannot seem to get the code working. I'm looking to remove the "Last Name" field required for email sign up. I currently have business plan, have tried pasting a variety of codes I have found on the web and nothing seems to work. I am trying to apply this to the landing page where I have successfully removed the header and footer as I want the sign up to be the only action people can take. Is anyone able to help? Thanks, Ben. Edited May 13, 2021 by Benny_S Mapa 1 Link to comment
tuanphan Posted May 14, 2021 Share Posted May 14, 2021 Add to Settings > Advanced > Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/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> <style> .newsletter-form-field-wrapper.field.last-name { display: none; } </style> I think this code by @sf.digital knellans 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
Benny_S Posted May 18, 2021 Author Share Posted May 18, 2021 Thank you so much for your help! I really appreciate it!!!! Link to comment
Benny_S Posted May 18, 2021 Author Share Posted May 18, 2021 Just gave it a go and doesn't seem to work Its erroring, apparently the field still requires last name although the field block is not visible Take a look at the attached. Cheers, Ben. Link to comment
tuanphan Posted May 19, 2021 Share Posted May 19, 2021 15 hours ago, Benny_S said: Just gave it a go and doesn't seem to work Its erroring, apparently the field still requires last name although the field block is not visible Take a look at the attached. Cheers, Ben. Keep this code in Code injection Footer, then let me know. Wee can test code easier <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></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
Benny_S Posted May 19, 2021 Author Share Posted May 19, 2021 That seems to have done the trick! Have tested and is working a charm! Many thanks once again! Link to comment
JanuaryMade Posted November 13, 2021 Share Posted November 13, 2021 On 5/14/2021 at 9:03 PM, tuanphan said: Add to Settings > Advanced > Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/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> <style> .newsletter-form-field-wrapper.field.last-name { display: none; } </style> I think this code by @sf.digital Hi @tuanphan, I am using this on a client site and it's working perfectly on the newsletter subscriber field (yay!) however it's affecting my contact form on my Contact page – would you happen to know how to adjust the above code to just work for the newsletter subscribe? Website: https://magnolia-sealion-mwc2.squarespace.com/contact Password: TMR2021 Thank you so much! Link to comment
tuanphan Posted November 15, 2021 Share Posted November 15, 2021 On 11/13/2021 at 8:56 AM, JanuaryMade said: Hi @tuanphan, I am using this on a client site and it's working perfectly on the newsletter subscriber field (yay!) however it's affecting my contact form on my Contact page – would you happen to know how to adjust the above code to just work for the newsletter subscribe? Website: https://magnolia-sealion-mwc2.squarespace.com/contact Password: TMR2021 Thank you so much! Try this <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/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> <style> .newsletter-form-field-wrapper.field.last-name { display: none; } </style> jinlikegold 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
chewyyy Posted August 16, 2022 Share Posted August 16, 2022 @tuanphanhi! I'm having trouble with my newsletter block using your code. It's successfully removed the field for last name but I keep getting this error: the website is: thegoodclub.com pw: strawberry thank you! Link to comment
tuanphan Posted August 18, 2022 Share Posted August 18, 2022 On 8/16/2022 at 10:43 AM, chewyyy said: @tuanphanhi! I'm having trouble with my newsletter block using your code. It's successfully removed the field for last name but I keep getting this error: the website is: thegoodclub.com pw: strawberry thank you! I just try submit an email. It looks fine to me. Can you check it again? 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