Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
How can I align button and input on the same line and get their results to display below both?

I have a button and a search bar. The button is above the search bar. When I click on the button, it returns my data just above the search bar.

When I search, it returns it below the search bar, while still showing results from the initial button clicked - so I have two results on the page at the same time.

  1. How can I place the Get Data button and Search Cities search bar side by side?

  2. Make the results show below both buttons.

  3. How can I Prevent both results from showing at the same time without clearing the initial returned data?

Sharing my html and css code and an image of what i am getting with it:

.user-form {
  width: 100%;
  max-width: 700px;
}

.user-form input {
  width: 100%;
  display: block;
  background-color: #4c2885;
  border: none;
  border-radius: 10px;
  color: #fff;
  padding: 1rem;
  margin-bottom: 2rem;
  font-family: inherit;
  font-size: 1rem;
  box-shadow: 0 5px 10px rgba(154, 160, 185, 0.05),
    0 15px 40px rgba(0, 0, 0, 0.1);
}

.user-form input::placeholder {
  color: #bbb;
}

.user-form input:focus {
  outline: none;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<button id="catalog" onclick="GetInfo()">Get Data</button>
<div id="data"></div>

<form class="user-form" id="form">
  <input type="search" id="input" placeholder="Search Cities">
</form>

<div id="myData"></div>

https://i.stack.imgur.com/ZCsEA.png

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I dont have all your code. You can try this and Let me know. I put wrapper on both of your button and form to flex it. If you want it to appear below you should put them outside of a wrapper or below on all the buttons or forms you have. Let me know if this works for you? If not let me know.

.user-form {
  width: 100%;
  max-width: 700px;
}


.user-form input {
  width: 100%;
  display: block;
  background-color: #4c2885;
  border: none;
  border-radius: 10px;
  color: #fff;
  padding: 1rem;
  margin-bottom: 2rem;
  font-family: inherit;
  font-size: 1rem;
  box-shadow: 0 5px 10px rgba(154, 160, 185, 0.05),
    0 15px 40px rgba(0, 0, 0, 0.1);
}

.user-form input::placeholder {
  color: #bbb;
}

.user-form input:focus {
  outline: none;
}

#catalog {
  height: 50px;
  }
  
.wrapper {
  display: flex;
  justify-content:left;
  grid-gap:10px;
  }
 
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<div class="wrapper">
<button id="catalog" onclick="GetInfo()">Get Data</button>

<form class="user-form" id="form">
  <input type="search" id="input" placeholder="Search Cities">
</form>
</div>

<div id="data">This will appear here </div>
<div id="myData">this will appear here </div>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!