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

180
Vistas
How do I autofill a textbox with data I just clicked with href?

enter image description hereIf I click on sender 'haq', how can I redirect to the messaging page and autofill 'haq' into the username text box?enter image description here

My code with the href is below:

return (
    <html className="u">
    <div className="form-container">
        <h1 className="message-text">Inbox</h1>
        <table className="table-box">
            <tr>
                <th>Sender </th>
                <th>Message</th>
            </tr>

            {messageList.map((val,key) => 
            {
                return (
            

            <tr>
                <a href = {"http://localhost:3000" + "/Message"}><td>{val.Sender}</td> </a>
                <td>{val.Message}</td>
            </tr>
                );
            })}
        </table>
    </div>
    </html>
);   

}

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have to get the value of the parameter message (How to do that). Then after getting the value, assign it to the textbox.

Example:

// Get value of parameter in URL
let example_url = "http://www.example.com/message=helloWorld"; // window.location.href
let url = new URL(example_url);
let message = url.searchParams.get("message")

// Assign value to textbox
document.getElementById("textbox").value = message;
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