Posts

Showing posts with the label shopify

Concatenate user and hidden input in form to append URL

Concatenate user and hidden input in form to append URL I’m using onsubmit to concatenate an input search value with a hidden set value in a form using get method as a workaround to hide certain products from search in shopify . <form action="/search" method="get" role="search" onsubmit="q.value = search.value +' '+ myset.value";> {% include 'icon-search' %} {{ 'general.search.submit' | t }} </div> It works but results in a messy URL because I end up with a URL that has all the input data plus the concatenated output. Basically all I need to do is append my set value to the end of the search query eg. http://www.example.com/search?q=usersearchvalue+mysetvalue But is there a neater way to achieve this result? TIA your code where is it ? – Muhammad Omer Aslam 2 days ago ...