Is it possible to do a storefront search using checkboxes and not a search field?

When i do this:


I get this output:

/search?q=

which is missing the value…

If i do this:


i get the correct output: /search?q=Floor (dependant on what is typed in the textfield)

Any expert who knows what is going on?

( If i change the name attribute’s value to anything else than “q” then it shows the correct output and doesen’t “delete” whatever comes after the “=” )

Not sure how it relates, but the q probably stands for query. An option I can think of is to leave the text input there, but hide it. Then when submit is clicked, prevent the submission, get the value of the checked checkbox and push it into the hidden text field, then submit the form. Are you going to have multiple checkboxes? And are they all going to be able to be checked? Meaning you could submit multiple terms? If that were the case how would you want to submit them? For instance you check “Floor” and “Chair” how would you want them placed into the search input? “Floor, Chair” “Floor Chair” etc.

If you’re only doing one option radio buttons may be more appropriate because you can’t select more than one if they have the same name.

Hey, thanks for the reply, didn’t think of that. Gonna try it.

There will be multiple options where more than one can be chosen at a time.

Ideally they would be submitted like this:

/search?q=floor+brown+tiles

Etc.

expecting to use javascript to remove the q= on multiple terms.

I got this working, just change whatever you want:


  
  

Hmm. Doesn’t work for me. Still nothing after q=

I think i found the error actually. It seems there’s a plugin or something, overriding all the attributes in input fields for some reason.

Can’t believe that took me 3 days.

Thanks alot for the help anyways, i am still gonna use your script since it could be useful later, so it was not all in vain.

No problem, feel free to reach out if you have any other questions. I check the forums every day other than the weekends so if you send me a DM here I’ll be sure to get back to you.