Jump to content

Search query string


Devine97
 Share

Recommended Posts

Hi all,

I’m learning to code and building a site to push my learning along. However, I am having a frustrating issue. 

On my site I would like to have search functionality, but for the search to be completed on a different URL. I understand this requires query parameters, but I'm a bit lost.

For example, if my site is “www.mysite.com” I would like a user to be able to input their city (could be any city in the world) and then select an option from a dropdown menu, say ‘running’ or ‘cycling’ and then the combination of the two querys added together and executed on “www.fitnessbuddies123xyz.com” (for example) and if someone had added a listing for a fitness buddy on “www.fitnessbuddies123xyz.com” and the string matched a URL on that site then the results would appear.

My current HTML is below:
Firstly, I have a text box:

<input type="text" class="form-control-lg form-control" id="inputText12" placeholder="City">

And then there is a drop-down menu, with three set options:

<select class="form-control form-control-lg" id="exampleFormControlSelect1">
      <option>Running</option>
      <option>Cycling</option>
      <option>Walking</option>
      </select>

I then have a button:

<a href="url" class="btn btn-lg btn-block btn-primary">Search</a>

Any help on how I can create the query string for the text box and dropdown menu and then execute on an external URL would be much appreciated.

Thanks in advance!
 

Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...