Jump to content
Sign in to follow this  
Devine97

Search query string

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!
 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...