Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda