Jump to content

Using Custom HTML in Form Block Fields

Go to solution Solved by creedon,

Recommended Posts

I used the template to create a job application form for my client. They requested a unique formatting for the Employment History section to simplify it. I was able to figure out a work-around in formatting and used Custom HTML and CSS to get it set up correctly. The issue now, is the custom fields are not being captured in the submitted form. 

To create the custom fields, I used the "Line field" and I put the custom HTML in the label and everything populated exactly how I wanted it.  The issue is the submission does not include any of these fields. The output stops after the answer for the last question "Are you willing to work weekend, holidays and overtime?"

How can I inject code to get the email to record these fields? I tried to use JavaScript in the Page Header Code Injection section. Any assistance would be great! 

 

Screenshot 2024-04-30 at 1.54.42 PM.png

Screenshot 2024-04-30 at 2.01.02 PM.png

Screenshot 2024-04-30 at 2.04.13 PM.png

Link to comment
  • Replies 3
  • Views 598
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Several issues.

Line fields are for visual purposes not capturing data. Also, although your HTML worked visually by entering it in the Line field LABEL, I wouldn't depend on that continuing. Unless a field is marked as accepting HTML best practice is not to use it that way. People have been burned by doing this and then Squarespace changes how fields work and your custom code breaks. Lastly entering HTML this way doesn't mean Squarespace would understand the form fields you created outside of their form builder and process them for you.

Looking at your screenshot is the main thing you wanted to achieve multiple fields on a row? This is something Squarespace doesn't do, unless they built it into one of their fields types. If so perhaps the following would be of use to you.

My code doesn't allow mixed column numbers. For example two columns on one row and three on another.

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
On 4/30/2024 at 3:52 PM, creedon said:

Several issues.

Line fields are for visual purposes not capturing data. Also, although your HTML worked visually by entering it in the Line field LABEL, I wouldn't depend on that continuing. Unless a field is marked as accepting HTML best practice is not to use it that way. People have been burned by doing this and then Squarespace changes how fields work and your custom code breaks. Lastly entering HTML this way doesn't mean Squarespace would understand the form fields you created outside of their form builder and process them for you.

Looking at your screenshot is the main thing you wanted to achieve multiple fields on a row? This is something Squarespace doesn't do, unless they built it into one of their fields types. If so perhaps the following would be of use to you.

My code doesn't allow mixed column numbers. For example two columns on one row and three on another.

Thanks so much for the insight that is good to know! However I was not able to see the your image. it said I did not have permission. What do you recommend to move forward with creating this page for the client? This is my first site build so any advice is appreciated. 

Link to comment
  • Solution
2 hours ago, AshleyAR said:

However I was not able to see

I have updated my post so you can access the content.

Quote

What do you recommend to move forward with creating this page for the client?

My suggestion is the same. Imagine if you could have multiple columns in a Squarespace form. Would SS's current form fields do the trick. Can they be laid out and styled as you want. If yes, then try to bend SS's forms to your will using CSS and JavaScript. My post which you should now be able to access might help you get there.

If no, then go to an outside forms provider. Keeping in mind that as soon as you go outside, those forms will not integrate with SS's backend systems.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.