I used these tips to get placeholder text added for first name, last name, and phone several months ago, but with Squarespace's recent form changes those additions have all broken. I assume this has happened to everyone using the method described in this thread. Does anyone know how the code needs to be edited in light of Squarespace's changes to get the placeholder text working again?
This is what I have that was working great until the last week or two:
<script>
$( ( ) => {
/*
add placeholder text to first and last name fields in "Get in touch!"
form for v7.1 site.
SS version : 7.1
*/
const dataFormId = '633881aed705ef0f2a50d02b';
const firstNamePlaceholderText = '*First Name';
const lastNamePlaceholderText = '*Last Name';
// do not change anything below
let $form = $( '[data-form-id="' + dataFormId + '"]' );
$( '.first-name input', $form )
.attr ( 'placeholder', firstNamePlaceholderText );
$( '.last-name input', $form )
.attr ( 'placeholder', lastNamePlaceholderText );
$( '.phone .three-digits input', $form )
.attr ( 'placeholder', '###' );
$( '.phone .four-digits input', $form )
.attr ( 'placeholder', '####' );
} );
</script>