kyleigh.wentworth
-
Posts
2 -
Joined
-
Last visited
Content Type
Forums
Gallery
Blogs
Events
Store
Downloads
Profiles
Posts posted by kyleigh.wentworth
-
-
On 2/16/2021 at 7:12 PM, creedon said:
Add the following to Settings > Advanced > Code Injection > HEADER.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
Add the following to Page Settings > Advanced > Page Header Code Injection for the contact page.
<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 = '601ced4f7050527e47ff6076'; const firstNamePlaceholderText = 'first'; const lastNamePlaceholderText = 'last'; // do not change anything below, there be the borg here let $form = $( '[data-form-id="' + dataFormId + '"]' ); $( '.first-name input', $form ) .attr ( 'placeholder', firstNamePlaceholderText ); $( '.last-name input', $form ) .attr ( 'placeholder', lastNamePlaceholderText ); } ); </script>
Let us know how it goes.
Not to bring back a dead thread, but I was able to adjust this code to work for my form and I have a few extra fields in mine. Names, Email, Phone, Date.
I was able to add the bit for email placeholder and even phone, but was wondering if there was a way to target the individual phone inputs? I'd like to have "###" in the first two and "####" in the last box to indicate the number of digits accepted.
Would want to do the same with date "MM" "DD" "YYYY" but could probably figure that out from the format of the phone one, if it's even possible.
Lightbox form: How to add form field placeholders?
in Customize with code
Posted
@creedon Worked PERFECTLY!! And was able to get the date fields as well. THANK. YOU SO MUCH!