Jump to content

Select form options by clicking on images in product description

Recommended Posts

Site URL: https://swordfish-tambourine-xk3b.squarespace.com/customise-custom-1

Hi there,

I'm trying to use javascript to improve the UX of my product order page.

I have a product form with a number of select boxes ("Type of wood", "Wood finish" etc) to select different product options. In the product description I have photos of those different images.

I am proficient with Javascript and I have been succesfull in hacking this functionality. If you click the photos, the select boxes are changed to your selection (it also puts a border around your chosen selection and this border is changed if you manually change the option in the select box).

However, if you try to submit the form, an error pops up saying "You must select options", despite the options being selected. If you then manually touch the select boxes, the error no longer pops up and you can submit the form.

I have a feeling that this might be because you are using some sort of state management solution in the background (React?) or something like that. 

So my question is: is there a way that I can stop this error from occuring? If I'm right about it being a state management solution, is there a hack for it? A way to change the options directly with the state manager perhaps?

Many thanks,
Ben Jackson (a web developer working on behalf of Lawrence Beckwith)

Link to comment
  • Replies 2
  • Views 607
  • Created
  • Last Reply


This topic is now archived and is closed to further replies.

  • 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.